diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-07-25 16:35:37 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-07-27 10:55:30 +0200 |
commit | 1fcac5adc5ed38fb88ce4c6d24b2ca2e27e3cd10 (patch) | |
tree | 7d2fed265befa680902ff146acb3305a360f9116 /cpukit/score/include/rtems/score/schedulerimpl.h | |
parent | score: Priority inherit thread queue operations (diff) | |
download | rtems-1fcac5adc5ed38fb88ce4c6d24b2ca2e27e3cd10.tar.bz2 |
score: Turn thread lock into thread wait lock
The _Thread_Lock_acquire() function had a potentially infinite run-time
due to the lack of fairness at atomic operations level.
Update #2412.
Update #2556.
Update #2765.
Diffstat (limited to 'cpukit/score/include/rtems/score/schedulerimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/schedulerimpl.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/schedulerimpl.h b/cpukit/score/include/rtems/score/schedulerimpl.h index db4be99f79..f8c29e215c 100644 --- a/cpukit/score/include/rtems/score/schedulerimpl.h +++ b/cpukit/score/include/rtems/score/schedulerimpl.h @@ -825,6 +825,20 @@ RTEMS_INLINE_ROUTINE void _Scheduler_Node_set_priority( #endif } +RTEMS_INLINE_ROUTINE void _Scheduler_Thread_set_priority( + Thread_Control *the_thread, + Priority_Control new_priority, + bool prepend_it +) +{ + Scheduler_Node *own_node; + + own_node = _Scheduler_Thread_get_own_node( the_thread ); + _Scheduler_Node_set_priority( own_node, new_priority, prepend_it ); + + the_thread->current_priority = new_priority; +} + #if defined(RTEMS_SMP) /** * @brief Gets an idle thread from the scheduler instance. |