[PATCH] score: Comment _Thread_queue_Enqueue_critical()

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jun 9 13:15:24 UTC 2016


---
 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 1e95003..8bd1905 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,
-- 
1.8.4.5



More information about the devel mailing list