summaryrefslogtreecommitdiff
path: root/nuttx/examples/ostest/sem.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-02-27 21:17:21 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-02-27 21:17:21 +0000
commit148cde5e982950ad5836fa96baa466de842e1c14 (patch)
treebf737b367b91c5da81345eb21016b07400d7a72f /nuttx/examples/ostest/sem.c
parentf6b81a790c28d7d36d9de33810df5270c1ebbfd7 (diff)
downloadpx4-nuttx-148cde5e982950ad5836fa96baa466de842e1c14.tar.gz
px4-nuttx-148cde5e982950ad5836fa96baa466de842e1c14.tar.bz2
px4-nuttx-148cde5e982950ad5836fa96baa466de842e1c14.zip
Finally, a clean SDCC compile
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@20 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/ostest/sem.c')
-rw-r--r--nuttx/examples/ostest/sem.c15
1 files changed, 12 insertions, 3 deletions
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
}