⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 proc2.cc

📁 Murphy 大俠 GPL 的 C++/x86 RTOS, 支持 MMU, 用戶/核心 模式區隔. http://hpc.ee.ntu.edu.tw/~murphy/me/EKernel.html
💻 CC
字号:
typedef unsigned long dword;

#include "stdio.h"
#include "SystemCallLib.h"

dword nSemaphoreID;

void main()
{

	while(OpenSemaphore(&nSemaphoreID, "Semaphore1")!=0);

	//printf("proc2 main thread semaphore ID = %d\n", nSemaphoreID);

	while(1)
	{
		WaitSemaphore(nSemaphoreID, true);
		SerialPutchar('m');
		SerialPutchar('a');
		SerialPutchar('i');
		SerialPutchar('n');
		SerialPutchar('2');
		SerialPutchar('\n');
		SignalSemaphore(nSemaphoreID);
		for(int i=0;i<0x300000;i++);
	};
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -