From dafa5d88435853809040761b79ab9d8f2217281b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 3 Sep 2015 10:27:16 +0200 Subject: score: Implement priority boosting --- cpukit/score/src/mutex.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'cpukit/score/src/mutex.c') diff --git a/cpukit/score/src/mutex.c b/cpukit/score/src/mutex.c index ae637dda84..f03bab76ee 100644 --- a/cpukit/score/src/mutex.c +++ b/cpukit/score/src/mutex.c @@ -112,9 +112,7 @@ static void _Mutex_Acquire_slow( ISR_lock_Context *lock_context ) { - /* Priority inheritance */ - _Thread_Raise_priority( owner, executing->current_priority ); - + _Thread_Inherit_priority( owner, executing ); _Thread_queue_Enqueue_critical( &mutex->Queue.Queue, MUTEX_TQ_OPERATIONS, @@ -136,15 +134,22 @@ static void _Mutex_Release_slow( { if (heads != NULL) { const Thread_queue_Operations *operations; - Thread_Control *first; + Thread_Control *first; + bool unblock; operations = MUTEX_TQ_OPERATIONS; first = ( *operations->first )( heads ); mutex->owner = first; - _Thread_queue_Extract_critical( + unblock = _Thread_queue_Extract_locked( &mutex->Queue.Queue, operations, + first + ); + _Thread_queue_Boost_priority( &mutex->Queue.Queue, first ); + _Thread_queue_Unblock_critical( + unblock, + &mutex->Queue.Queue, first, lock_context ); -- cgit v1.2.3