summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/mutex.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-07-26 10:34:21 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-07-27 10:55:30 +0200
commitd79df38c2bea50112214ade95776cb90d693e390 (patch)
tree77bcc6ae76dde57c449d808ef2cce318cd198b06 /cpukit/score/src/mutex.c
parentscore: Turn thread lock into thread wait lock (diff)
downloadrtems-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/mutex.c')
-rw-r--r--cpukit/score/src/mutex.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cpukit/score/src/mutex.c b/cpukit/score/src/mutex.c
index 12a4f292e1..085d5c2945 100644
--- a/cpukit/score/src/mutex.c
+++ b/cpukit/score/src/mutex.c
@@ -108,6 +108,10 @@ static void _Mutex_Acquire_slow(
)
{
_Thread_queue_Context_set_expected_level( queue_context, 1 );
+ _Thread_queue_Context_set_deadlock_callout(
+ queue_context,
+ _Thread_queue_Deadlock_fatal
+ );
_Thread_queue_Enqueue_critical(
&mutex->Queue.Queue,
MUTEX_TQ_OPERATIONS,