summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-02-13 15:37:33 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-02-13 15:37:33 +0000
commit18269cef34e796931cbf7d6f7b3e1a23c1830bf8 (patch)
tree787a1f1d5d5997734efe6e68ec380b90a4cabdce /cpukit/rtems
parent*** empty log message *** (diff)
downloadrtems-18269cef34e796931cbf7d6f7b3e1a23c1830bf8.tar.bz2
comment added to describe synchronization logic in timeout routine
Diffstat (limited to 'cpukit/rtems')
-rw-r--r--cpukit/rtems/src/event.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/cpukit/rtems/src/event.c b/cpukit/rtems/src/event.c
index 3042de2676..141c5411cf 100644
--- a/cpukit/rtems/src/event.c
+++ b/cpukit/rtems/src/event.c
@@ -198,14 +198,22 @@ void _Event_Seize(
switch ( sync_state ) {
case EVENT_SYNC_SYNCHRONIZED:
+ /*
+ * This cannot happen. It indicates that this routine did not
+ * enter the synchronization states above.
+ */
+ return;
+
case EVENT_SYNC_NOTHING_HAPPENED:
_ISR_Enable( level );
return;
+
case EVENT_SYNC_TIMEOUT:
executing->Wait.return_code = RTEMS_TIMEOUT;
_ISR_Enable( level );
_Thread_Unblock( executing );
return;
+
case EVENT_SYNC_SATISFIED:
if ( _Watchdog_Is_active( &executing->Timer ) ) {
_Watchdog_Deactivate( &executing->Timer );
@@ -328,6 +336,19 @@ void _Event_Timeout(
case OBJECTS_REMOTE: /* impossible */
break;
case OBJECTS_LOCAL:
+
+ /*
+ * If the event manager is not synchronized, then it is either
+ * "nothing happened", "timeout", or "satisfied". If the_thread
+ * is the executing thread, then it is in the process of blocking
+ * and it is the thread which is responsible for the synchronization
+ * process.
+ *
+ * If it is not satisfied, then it is "nothing happened" and
+ * this is the "timeout" transition. After a request is satisfied,
+ * a timeout is not allowed to occur.
+ */
+
if ( _Event_Sync_state != EVENT_SYNC_SYNCHRONIZED &&
_Thread_Is_executing( the_thread ) ) {
if ( _Event_Sync_state != EVENT_SYNC_SATISFIED )