1 | #include <OS.h>
|
---|
2 | #include <stdio.h>
|
---|
3 |
|
---|
4 | int32 th(void *p)
|
---|
5 | {
|
---|
6 | return 0;
|
---|
7 | }
|
---|
8 |
|
---|
9 | int32 thw(void *p)
|
---|
10 | {
|
---|
11 | sleep(1);
|
---|
12 | return 0;
|
---|
13 | }
|
---|
14 |
|
---|
15 | int main()
|
---|
16 | {
|
---|
17 | status_t err, st;
|
---|
18 | thread_id tid;
|
---|
19 | tid = spawn_thread(th, "th", B_NORMAL_PRIORITY, NULL);
|
---|
20 | resume_thread(tid);
|
---|
21 | err = wait_for_thread(tid, &st);
|
---|
22 | printf("err = %08x st = %08x\n", err, st);
|
---|
23 | tid = spawn_thread(thw, "th", B_NORMAL_PRIORITY, NULL);
|
---|
24 | resume_thread(tid);
|
---|
25 | err = wait_for_thread(tid, &st);
|
---|
26 | printf("err = %08x st = %08x\n", err, st);
|
---|
27 | }
|
---|