diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2013-11-30 16:06:07 -0600 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2013-11-30 16:06:07 -0600 |
commit | adc2301723ad8b8ddb17d51c7d38950865db8b44 (patch) | |
tree | 50aef8db7695708da86e1a1d7c39dc12b1861e92 /testsuites/psxtmtests | |
parent | fixed psxtmthread02 test, updated .csv to be in sync and added test .docs (diff) | |
download | rtems-adc2301723ad8b8ddb17d51c7d38950865db8b44.tar.bz2 |
psxtmthread02/init.c: Fix warnings
Diffstat (limited to 'testsuites/psxtmtests')
-rw-r--r-- | testsuites/psxtmtests/psxtmthread02/init.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/testsuites/psxtmtests/psxtmthread02/init.c b/testsuites/psxtmtests/psxtmthread02/init.c index bfa3ab8c9a..6d5333a098 100644 --- a/testsuites/psxtmtests/psxtmthread02/init.c +++ b/testsuites/psxtmtests/psxtmthread02/init.c @@ -13,6 +13,7 @@ #include <timesys.h> #include <pthread.h> +#include <sched.h> #include <rtems/timerdrv.h> #include "test_support.h" @@ -28,11 +29,18 @@ void benchmark_pthread_create(void) pthread_attr_t attr; struct sched_param param; - pthread_attr_init(&attr); - pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); - pthread_attr_setschedpolicy(&attr, SCHED_FIFO); + status = pthread_attr_init(&attr); + rtems_test_assert( status == 0 ); + + status = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); + rtems_test_assert( status == 0 ); + + status = pthread_attr_setschedpolicy(&attr, SCHED_FIFO); + rtems_test_assert( status == 0 ); + param.sched_priority = sched_get_priority_max(SCHED_FIFO) - 1; - pthread_attr_setschedparam(&attr, ¶m); + status = pthread_attr_setschedparam(&attr, ¶m); + rtems_test_assert( status == 0 ); /* create second thread with max priority and get preempted on creation */ benchmark_timer_initialize(); |