From 148cde5e982950ad5836fa96baa466de842e1c14 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 27 Feb 2007 21:17:21 +0000 Subject: Finally, a clean SDCC compile git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@20 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/examples/ostest/sem.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'nuttx/examples/ostest/sem.c') diff --git a/nuttx/examples/ostest/sem.c b/nuttx/examples/ostest/sem.c index 73be6910e..f6e6ddbb5 100644 --- a/nuttx/examples/ostest/sem.c +++ b/nuttx/examples/ostest/sem.c @@ -144,6 +144,9 @@ void sem_test(void) pthread_t waiter_thread1; pthread_t waiter_thread2; pthread_t poster_thread; +#ifdef SDCC + pthread_addr_t result; +#endif struct sched_param sparam; int prio_min; int prio_max; @@ -178,7 +181,7 @@ void sem_test(void) printf("sem_test: Set thread 1 priority to %d\n", sparam.sched_priority); } - status = pthread_create(&waiter_thread1, &attr, waiter_func, (void*)1); + status = pthread_create(&waiter_thread1, &attr, waiter_func, (pthread_addr_t)1); if (status != 0) { printf("sem_test: Error in thread 1 creation, status=%d\n", status); @@ -202,7 +205,7 @@ void sem_test(void) printf("sem_test: Set thread 2 priority to %d\n", sparam.sched_priority); } - status = pthread_create(&waiter_thread2, &attr, waiter_func, (void*)2); + status = pthread_create(&waiter_thread2, &attr, waiter_func, (pthread_addr_t)2); if (status != 0) { printf("sem_test: Error in thread 2 creation, status=%d\n", status); @@ -226,13 +229,19 @@ void sem_test(void) printf("sem_test: Set thread 3 priority to %d\n", sparam.sched_priority); } - status = pthread_create(&poster_thread, &attr, poster_func, (void*)3); + status = pthread_create(&poster_thread, &attr, poster_func, (pthread_addr_t)3); if (status != 0) { printf("sem_test: Error in thread 3 creation, status=%d\n", status); } +#ifdef SDCC + pthread_join(waiter_thread1, &result); + pthread_join(waiter_thread2, &result); + pthread_join(poster_thread, &result); +#else pthread_join(waiter_thread1, NULL); pthread_join(waiter_thread2, NULL); pthread_join(poster_thread, NULL); +#endif } -- cgit v1.2.3