diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-12-01 21:06:53 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-12-01 21:06:53 +0000 |
commit | a26603d59850550335b39055079a17e4de1182bc (patch) | |
tree | 1a47a3a4f89bd3eb6d712715ee8fba47145a31ae /c/src/exec | |
parent | spurious blank line removed (diff) | |
download | rtems-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 'c/src/exec')
-rw-r--r-- | c/src/exec/rtems/src/event.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/c/src/exec/rtems/src/event.c b/c/src/exec/rtems/src/event.c index 2f087b3249..d388de0b81 100644 --- a/c/src/exec/rtems/src/event.c +++ b/c/src/exec/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 |