proc2.cc

来自「Murphy 大俠 GPL 的 C++/x86 RTOS, 支持 MMU, 用戶」· CC 代码 · 共 28 行

CC
28
字号
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 + =
减小字号Ctrl + -
显示快捷键?