diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-07-13 13:49:35 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-07-23 08:01:14 +0200 |
commit | e709aa8522788a45adc0adf22daac82c574fcae4 (patch) | |
tree | 0d98e853cde5065aac1fe4eda5517ac22d8445f9 /cpukit/score/src/coremutexsurrender.c | |
parent | score: Introduce Thread_queue_Heads (diff) | |
download | rtems-e709aa8522788a45adc0adf22daac82c574fcae4.tar.bz2 |
score: Move wait flag update to tq extract
This makes it possible to use _Thread_queue_Extract_locked() for barrier
operations which extract all threads on the queue in one critical
section.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/coremutexsurrender.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cpukit/score/src/coremutexsurrender.c b/cpukit/score/src/coremutexsurrender.c index e3f0d6f2e4..d3f965d55d 100644 --- a/cpukit/score/src/coremutexsurrender.c +++ b/cpukit/score/src/coremutexsurrender.c @@ -179,13 +179,15 @@ CORE_mutex_Status _CORE_mutex_Surrender( * transfer the mutex to that thread. */ if ( ( the_thread = _Thread_queue_First_locked( &the_mutex->Wait_queue ) ) ) { + bool unblock; + /* * We must extract the thread now since this will restore its default * thread lock. This is necessary to avoid a deadlock in the * _Thread_Change_priority() below due to a recursive thread queue lock * acquire. */ - _Thread_queue_Extract_locked( + unblock = _Thread_queue_Extract_locked( &the_mutex->Wait_queue.Queue, the_mutex->Wait_queue.operations, the_thread @@ -220,6 +222,7 @@ CORE_mutex_Status _CORE_mutex_Surrender( } _Thread_queue_Unblock_critical( + unblock, &the_mutex->Wait_queue.Queue, the_thread, lock_context |