sched1.c

来自「geekos 0.3.0简单的操作系统」· C语言 代码 · 共 31 行

C
31
字号
#include <conio.h>#include <process.h>#include <sched.h>#include <sema.h>#include <string.h>int main( int argc , char ** argv ){  int i,j ;     	/* loop index */  int holdsched3_sem;  holdsched3_sem = Create_Semaphore("holdsched3_sem",0);  for (i=0; i < 10; i++) {    for(j=0;j<20000;j++);    Print("1");  }  V(holdsched3_sem);  for (i=0; i < 10; i++) {    for(j=0;j<20000;j++);    Print("1");  }    Destroy_Semaphore(holdsched3_sem);  return 0;}

⌨️ 快捷键说明

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