Updated PCI IDs to latest snapshot.
[tangerine.git] / test / threads / threadexit.c
blob882ce3ba54b41153f641046afaa5593e723e231e
1 #include <libraries/thread.h>
2 #include <proto/thread.h>
3 #include <proto/dos.h>
4 #include <stdio.h>
6 void *thread_main(void *data) {
7 uint32_t id = CurrentThread();
9 printf("[%d] starting\n", id);
11 Delay(50);
13 printf("[%d] exiting\n", id);
15 return (void *) id;
18 int main (int argc, char **argv) {
19 int i;
20 uint32_t id[10], ret;
22 for (i = 0; i < 10; i++) {
23 id[i] = CreateThread(thread_main, NULL);
24 printf("created thread %d\n", id[i]);
25 Delay(25);
28 for (i = 0; i < 10; i++) {
29 printf("waiting for thread %d\n", id[i]);
30 WaitThread(id[i], (void **) &ret);
31 printf("thread %d return %d\n", id[i], ret);
34 return 0;