00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "copyright.h"
00013 #include "system.h"
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 void
00025 SimpleThread(int which)
00026 {
00027 int num;
00028
00029 for (num = 0; num < 5; num++) {
00030 printf("*** thread %d looped %d times\n", which, num);
00031 currentThread->Yield();
00032 }
00033 }
00034
00035
00036
00037
00038
00039
00040
00041 void
00042 ThreadTest()
00043 {
00044 DEBUG('t', "Entering SimpleTest");
00045
00046 Thread *t = new Thread("forked thread");
00047
00048 t->Fork(SimpleThread, 1);
00049 SimpleThread(0);
00050 }
00051
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees