diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2015-05-21 18:08:32 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2015-05-21 18:08:32 -0500 |
commit | 24acc6d0c092c244881dd6ffadc3782a8136fccc (patch) | |
tree | 864b4985a7a431bd3520e9d815927eee5315c2df /cpukit/rtems/src/tasksetpriority.c | |
parent | Merge branch 'master' of ssh://dispatch.rtems.org/data/git/rtems (diff) | |
parent | doc: Add new documentation section for Epiphany architecture (diff) | |
download | rtems-24acc6d0c092c244881dd6ffadc3782a8136fccc.tar.bz2 |
Merge branch 'master' of ssh://dispatch.rtems.org/data/git/rtems
Diffstat (limited to 'cpukit/rtems/src/tasksetpriority.c')
-rw-r--r-- | cpukit/rtems/src/tasksetpriority.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/cpukit/rtems/src/tasksetpriority.c b/cpukit/rtems/src/tasksetpriority.c index 4e4835675d..582c67f9f2 100644 --- a/cpukit/rtems/src/tasksetpriority.c +++ b/cpukit/rtems/src/tasksetpriority.c @@ -41,16 +41,18 @@ rtems_status_code rtems_task_set_priority( switch ( location ) { case OBJECTS_LOCAL: - *old_priority = _RTEMS_tasks_Priority_from_Core( - the_thread->current_priority - ); if ( new_priority != RTEMS_CURRENT_PRIORITY ) { - the_thread->real_priority = _RTEMS_tasks_Priority_to_Core( - new_priority - ); - if ( !_Thread_Owns_resources( the_thread ) || - the_thread->current_priority > new_priority ) - _Thread_Change_priority( the_thread, new_priority, false ); + _Thread_Set_priority( + the_thread, + _RTEMS_tasks_Priority_to_Core( new_priority ), + old_priority, + false + ); + *old_priority = _RTEMS_tasks_Priority_from_Core( *old_priority ); + } else { + *old_priority = _RTEMS_tasks_Priority_from_Core( + the_thread->current_priority + ); } _Objects_Put( &the_thread->Object ); return RTEMS_SUCCESSFUL; |