summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtmtests/psxtmthread02/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/psxtmtests/psxtmthread02/init.c')
-rw-r--r--testsuites/psxtmtests/psxtmthread02/init.c16
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, &param);
+ status = pthread_attr_setschedparam(&attr, &param);
+ rtems_test_assert( status == 0 );
/* create second thread with max priority and get preempted on creation */
benchmark_timer_initialize();