3 // This software is copyright (c) 2006 Scott Wood <scott@buserror.net>.
5 // This software is provided 'as-is', without any express or implied warranty.
6 // In no event will the authors or contributors be held liable for any damages
7 // arising from the use of this software.
9 // Permission is hereby granted to everyone, free of charge, to use, copy,
10 // modify, prepare derivative works of, publish, distribute, perform,
11 // sublicense, and/or sell copies of the Software, provided that the above
12 // copyright notice and disclaimer of warranty be included in all copies or
13 // substantial portions of this software.
15 #include <kern/types.h>
16 #include <kern/libc.h>
17 #include <kern/time.h>
18 #include <kern/thread.h>
19 #include <util/lock.h>
23 void threadb(void *arg)
29 Time::monotonic_clock.get_time(&now);
35 Time::monotonic_clock.get_time(&now2);
37 if (now.seconds != now2.seconds)
46 void threada(void *arg)
48 Threads::sched.new_thread(threadb, NULL, "thread b")->wake();
54 Time::monotonic_clock.get_time(&now);
60 Time::monotonic_clock.get_time(&now2);
62 if (now.seconds != now2.seconds)
74 Threads::sched.new_thread(threada, NULL, "thread a")->wake();