[rtems commit] score: Comment _Thread_queue_Enqueue_critical()
Sebastian Huber
sebh at rtems.org
Fri Jun 10 12:08:50 UTC 2016
Module: rtems
Branch: master
Commit: 7bf9c8bea7063fb2053e59dd1af766de7345458a
Changeset: http://git.rtems.org/rtems/commit/?id=7bf9c8bea7063fb2053e59dd1af766de7345458a
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Thu Jun 9 15:14:19 2016 +0200
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 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,
More information about the vc
mailing list