summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-12-01 21:06:53 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-12-01 21:06:53 +0000
commita26603d59850550335b39055079a17e4de1182bc (patch)
tree1a47a3a4f89bd3eb6d712715ee8fba47145a31ae /cpukit/rtems/src
parentspurious blank line removed (diff)
downloadrtems-a26603d59850550335b39055079a17e4de1182bc.tar.bz2
Changed code for exit from synchronization state to a switch on the
possible synchronization actions. This should have made it harder to avoid a case.
Diffstat (limited to 'cpukit/rtems/src')
-rw-r--r--cpukit/rtems/src/event.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/cpukit/rtems/src/event.c b/cpukit/rtems/src/event.c
index 2f087b3249..d388de0b81 100644
--- a/cpukit/rtems/src/event.c
+++ b/cpukit/rtems/src/event.c
@@ -196,18 +196,26 @@ void _Event_Seize(
_Thread_Set_state( executing, STATES_WAITING_FOR_EVENT );
_ISR_Disable( level );
- if ( _Event_Sync == TRUE ) {
- _Event_Sync = FALSE;
- _ISR_Enable( level );
- return;
+ switch ( _Event_Sync_state ) {
+ case EVENT_SYNC_NOTHING_HAPPENED:
+ _Event_Sync = FALSE;
+ _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 );
+ _ISR_Enable( level );
+ (void) _Watchdog_Remove( &executing->Timer );
+ } else
+ _ISR_Enable( level );
+ _Thread_Unblock( executing );
+ return;
}
- if ( _Event_Sync_state == EVENT_SYNC_TIMEOUT )
- executing->Wait.return_code = RTEMS_TIMEOUT;
- _ISR_Enable( level );
- if ( ticks )
- (void) _Watchdog_Remove( &executing->Timer );
- _Thread_Unblock( executing );
- return;
}
/*PAGE