main.bak

来自「操作系统:用C++编写的时间片轮转法」· BAK 代码 · 共 41 行

BAK
41
字号
#include "INDOS.C"
#include "Function.C"

void main()
{
	initInDos();
	initTcb();
	freebuf = initBuf();
	oldInt8 = getvect(8);

	/* 创建0#线程 */
	strcpy(tcb[0].name,"main");
	tcb[0].state = RUNNING;
	tcb[0].value = 0;
	current = 0;	
	
	initView();
	PrintTcbState();
	setvect(8,newInt8);
/*
	create("f1",(codeptr)f1,1024);
	create("f2",(codeptr)f2,1024);
	printTcbState();
*/
	/* 启动多个线程的并发执行 */ 
	threadSwitch();

	while(!allThreadFinished()) ;
	/* 终止多任务系统  */
	tcb[0].name[0] = '\0';
	tcb[0].state = FINISHED;

	setvect(8,oldInt8);
	printf("\n");
	printTcbState();
	printf("\nMultiTask System terminated.\n");
//	getchar();
//	gets(words);

	return ;
} /* main */

⌨️ 快捷键说明

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