From 7bf9c8bea7063fb2053e59dd1af766de7345458a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 9 Jun 2016 15:14:19 +0200 Subject: score: Comment _Thread_queue_Enqueue_critical() --- cpukit/score/src/threadqenqueue.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c index 1e95003aa7..8bd19058ff 100644 --- a/cpukit/score/src/threadqenqueue.c +++ b/cpukit/score/src/threadqenqueue.c @@ -92,6 +92,15 @@ void _Thread_queue_Enqueue_critical( ); } + /* + * At this point thread dispatching is disabled, however, we already released + * the thread queue lock. Thus, interrupts or threads on other processors + * may already changed our state with respect to the thread queue object. + * The request could be satisfied or timed out. This situation is indicated + * by the thread wait flags. Other parties must not modify our thread state + * as long as we are in the THREAD_QUEUE_INTEND_TO_BLOCK thread wait state, + * thus we have to cancel the blocking operation ourself if necessary. + */ success = _Thread_Wait_flags_try_change( the_thread, THREAD_QUEUE_INTEND_TO_BLOCK, -- cgit v1.2.3