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/threadchangepriority.c | |
parent | score: Implement SMP-specific priority queue (diff) | |
download | rtems-dafa5d88435853809040761b79ab9d8f2217281b.tar.bz2 |
score: Implement priority boosting
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/threadchangepriority.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cpukit/score/src/threadchangepriority.c b/cpukit/score/src/threadchangepriority.c index 8f5d14f412..35e5e5bfbc 100644 --- a/cpukit/score/src/threadchangepriority.c +++ b/cpukit/score/src/threadchangepriority.c @@ -110,6 +110,40 @@ void _Thread_Raise_priority( ); } +#if defined(RTEMS_SMP) +static bool _Thread_Inherit_priority_filter( + Thread_Control *inheritor, + Priority_Control *new_priority, + void *arg +) +{ + Thread_Control *ancestor = arg; + + if ( _Scheduler_Get_own( inheritor ) == _Scheduler_Get_own( ancestor ) ) { + *new_priority = ancestor->current_priority; + } + + return _Thread_Priority_less_than( + inheritor->current_priority, + *new_priority + ); +} + +void _Thread_Inherit_priority( + Thread_Control *inheritor, + Thread_Control *ancestor +) +{ + _Thread_Change_priority( + inheritor, + PRIORITY_PSEUDO_ISR, + ancestor, + _Thread_Inherit_priority_filter, + false + ); +} +#endif + static bool _Thread_Restore_priority_filter( Thread_Control *the_thread, Priority_Control *new_priority, |