diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-07-26 10:34:21 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-07-27 10:55:30 +0200 |
commit | d79df38c2bea50112214ade95776cb90d693e390 (patch) | |
tree | 77bcc6ae76dde57c449d808ef2cce318cd198b06 /cpukit/score/src/coremutexseize.c | |
parent | score: Turn thread lock into thread wait lock (diff) | |
download | rtems-d79df38c2bea50112214ade95776cb90d693e390.tar.bz2 |
score: Add deadlock detection
The mutex objects use the owner field of the thread queues for the mutex
owner. Use this and add a deadlock detection to
_Thread_queue_Enqueue_critical() for thread queues with an owner.
Update #2412.
Update #2556.
Close #2765.
Diffstat (limited to 'cpukit/score/src/coremutexseize.c')
-rw-r--r-- | cpukit/score/src/coremutexseize.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cpukit/score/src/coremutexseize.c b/cpukit/score/src/coremutexseize.c index dacb274bdf..cfefc50333 100644 --- a/cpukit/score/src/coremutexseize.c +++ b/cpukit/score/src/coremutexseize.c @@ -62,6 +62,11 @@ Status_Control _CORE_mutex_Seize_slow( _Thread_queue_Context_set_expected_level( queue_context, 2 ); #endif + _Thread_queue_Context_set_deadlock_callout( + queue_context, + _Thread_queue_Deadlock_status + ); + _Thread_queue_Enqueue_critical( &the_mutex->Wait_queue.Queue, CORE_MUTEX_TQ_PRIORITY_INHERIT_OPERATIONS, @@ -87,6 +92,10 @@ Status_Control _CORE_mutex_Seize_no_protocol_slow( { if ( wait ) { _Thread_queue_Context_set_expected_level( queue_context, 1 ); + _Thread_queue_Context_set_deadlock_callout( + queue_context, + _Thread_queue_Deadlock_status + ); _Thread_queue_Enqueue_critical( &the_mutex->Wait_queue.Queue, operations, |