diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-09-03 10:27:16 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-09-04 13:26:17 +0200 |
commit | dafa5d88435853809040761b79ab9d8f2217281b (patch) | |
tree | 35d9d87cbe8d00279cc3fa905792569937ed7fea /cpukit/score/src/threadqops.c | |
parent | score: Implement SMP-specific priority queue (diff) | |
download | rtems-dafa5d88435853809040761b79ab9d8f2217281b.tar.bz2 |
score: Implement priority boosting
Diffstat (limited to 'cpukit/score/src/threadqops.c')
-rw-r--r-- | cpukit/score/src/threadqops.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cpukit/score/src/threadqops.c b/cpukit/score/src/threadqops.c index 07473f50bd..7b017793ed 100644 --- a/cpukit/score/src/threadqops.c +++ b/cpukit/score/src/threadqops.c @@ -293,6 +293,28 @@ static Thread_Control *_Thread_queue_Priority_first( return THREAD_RBTREE_NODE_TO_THREAD( first ); } +#if defined(RTEMS_SMP) +void _Thread_queue_Boost_priority( + Thread_queue_Queue *queue, + Thread_Control *the_thread +) +{ + Thread_queue_Heads *heads = queue->heads; + + if ( + heads != NULL + && ( + !_Chain_Has_only_one_node( &heads->Heads.Fifo ) + || _RBTree_Is_empty( + &_Thread_queue_Priority_queue( heads, the_thread )->Queue + ) + ) + ) { + _Thread_Raise_priority( the_thread, PRIORITY_PSEUDO_ISR ); + } +} +#endif + const Thread_queue_Operations _Thread_queue_Operations_default = { .priority_change = _Thread_queue_Do_nothing_priority_change, .extract = _Thread_queue_Do_nothing_extract |