diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-06-30 14:08:18 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-07-01 11:51:49 +0200 |
commit | c0bd0064ac41f0602c0abfe494dbe140d7c5282f (patch) | |
tree | aaa200033234cf2d3833305f13565171521b0d26 /testsuites/smptests/smppsxmutex01/init.c | |
parent | score: Workaround for #2751 (diff) | |
download | rtems-c0bd0064ac41f0602c0abfe494dbe140d7c5282f.tar.bz2 |
rtems: Fix rtems_task_set_scheduler() API
Task priorities are only valid within a scheduler instance. The
rtems_task_set_scheduler() directive moves a task from one scheduler
instance to another using the current priority of the thread. However,
the current task priority of the source scheduler instance is undefined
in the target scheduler instance. Add a third parameter to specify the
priority.
Close #2749.
Diffstat (limited to 'testsuites/smptests/smppsxmutex01/init.c')
-rw-r--r-- | testsuites/smptests/smppsxmutex01/init.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/testsuites/smptests/smppsxmutex01/init.c b/testsuites/smptests/smppsxmutex01/init.c index 761b5b9d51..1cd7be54bf 100644 --- a/testsuites/smptests/smppsxmutex01/init.c +++ b/testsuites/smptests/smppsxmutex01/init.c @@ -44,6 +44,7 @@ static void *thread_b(void *arg) test_context *ctx; rtems_id scheduler_b_id; rtems_status_code sc; + rtems_task_priority prio; int prio_ceiling; int eno; @@ -54,7 +55,10 @@ static void *thread_b(void *arg) sc = rtems_scheduler_ident(SCHED_B, &scheduler_b_id); rtems_test_assert(sc == RTEMS_SUCCESSFUL); - sc = rtems_task_set_scheduler(pthread_self(), scheduler_b_id); + sc = rtems_task_set_priority(pthread_self(), RTEMS_CURRENT_PRIORITY, &prio); + rtems_test_assert(sc == RTEMS_SUCCESSFUL); + + sc = rtems_task_set_scheduler(pthread_self(), scheduler_b_id, prio); rtems_test_assert(sc == RTEMS_SUCCESSFUL); rtems_test_assert(rtems_get_current_processor() == 1); |