From 93306058c0417b1c6e950b44ef279e096062dfba Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 27 May 2016 14:43:19 +0200 Subject: score: _CORE_mutex_Check_dispatch_for_seize() Move the safety check performed by _CORE_mutex_Check_dispatch_for_seize() out of the performance critical path and generalize it. Blocking on a thread queue with an unexpected thread dispatch disabled level is illegal in all system states. Add the expected thread dispatch disable level (which may be 1 or 2 depending on the operation) to Thread_queue_Context and use it in _Thread_queue_Enqueue_critical(). --- cpukit/score/src/coremsgsubmit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cpukit/score/src/coremsgsubmit.c') diff --git a/cpukit/score/src/coremsgsubmit.c b/cpukit/score/src/coremsgsubmit.c index a623291776..fb56ffed4a 100644 --- a/cpukit/score/src/coremsgsubmit.c +++ b/cpukit/score/src/coremsgsubmit.c @@ -132,13 +132,14 @@ Status_Control _CORE_message_queue_Submit( executing->Wait.option = (uint32_t) size; executing->Wait.count = submit_type; + _Thread_queue_Context_set_expected_level( queue_context, 1 ); _Thread_queue_Enqueue_critical( &the_message_queue->Wait_queue.Queue, the_message_queue->operations, executing, STATES_WAITING_FOR_MESSAGE, timeout, - &queue_context->Lock_context + queue_context ); return _Thread_Wait_get_status( executing ); #endif -- cgit v1.2.3