1 /* Problem 1-2: Join tests.
3 Based on a test originally submitted for Stanford's CS 140 in
4 winter 1998 by Rob Baesman <rbaesman@cs.stanford.edu>, Ben
5 Taskar <btaskar@cs.stanford.edu>, and Toli Kuznets
6 <tolik@cs.stanford.edu>. Later modified by shiangc, yph, and
9 #include "threads/test.h"
11 #include "threads/interrupt.h"
12 #include "threads/thread.h"
14 static void no_test (void);
22 static thread_func simple_thread_func;
31 "Should just not crash.\n");
32 tid0 = thread_create ("0", PRI_DEFAULT, simple_thread_func, "0");
33 simple_thread_func ("1");
34 printf ("Simple join test done.\n");
38 simple_thread_func (void *name_)
40 const char *name = name_;
43 for (i = 0; i < 5; i++)
45 printf ("Thread %s iteration %d\n", name, i);
48 printf ("Thread %s done!\n", name);