コード例 #1
0
ファイル: threadfunc.c プロジェクト: susienazaryan/os161
int threadtest5(int nargs, char **args ) {
	
	(void)nargs;
	int VNAME = atoi(args[1]);
	int upperBound = atoi(args[2]);
	unsafethreadcounter = 0;	
	init_sem();
	kprintf("starting thread test...\n");
	threadfun2(VNAME, upperBound);
	kprintf("\nThread test done.\n");
	V(tsem);
	kprintf("\nThe value of the unsafethreadcounter is %d. \n", unsafethreadcounter);
	kprintf("\nThe value of the unsafethreadcounter SHOULD be %d. \n", VNAME * upperBound );
	return 0;

}
コード例 #2
0
ファイル: main4.cpp プロジェクト: zhuodream/iOSLearn
// 死锁的例子
void test_thread_deadlock()
{
    threadfun2();
}