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; }
// 死锁的例子 void test_thread_deadlock() { threadfun2(); }