Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

Ticket #584: evtimeout.diff

File evtimeout.diff, 1.7 KB (added by Joel Sherrill, on 12/03/06 at 13:31:13)

evtimeout.diff

  • cpukit/rtems/src/eventtimeout.c

    RCS file: /usr1/CVS/rtems/cpukit/rtems/src/eventtimeout.c,v
    retrieving revision 1.2.6.1
    diff -u -r1.2.6.1 eventtimeout.c
     
    3939  void       *ignored
    4040)
    4141{
    42   Thread_Control *the_thread;
    43   Objects_Locations      location;
     42  Thread_Control    *the_thread;
     43  Objects_Locations  location;
     44  ISR_Level          level;
    4445
    4546  the_thread = _Thread_Get( id, &location );
    4647  switch ( location ) {
     
    6162       *  a timeout is not allowed to occur.
    6263       */
    6364
    64       if ( _Event_Sync_state != EVENT_SYNC_SYNCHRONIZED &&
    65            _Thread_Is_executing( the_thread ) ) {
    66         if ( _Event_Sync_state != EVENT_SYNC_SATISFIED )
    67           _Event_Sync_state = EVENT_SYNC_TIMEOUT;
    68       } else {
    69         the_thread->Wait.return_code = RTEMS_TIMEOUT;
    70         _Thread_Unblock( the_thread );
     65      _ISR_Disable( level );
     66      if ( the_thread->Wait.count ) {  /* verify thread is waiting */
     67        the_thread->Wait.count = 0;
     68        if ( _Event_Sync_state != EVENT_SYNC_SYNCHRONIZED &&
     69             _Thread_Is_executing( the_thread ) ) {
     70          if ( _Event_Sync_state != EVENT_SYNC_SATISFIED ) {
     71            _Event_Sync_state = EVENT_SYNC_TIMEOUT;
     72            }
     73          _ISR_Enable( level );
     74        } else {
     75            the_thread->Wait.return_code = RTEMS_TIMEOUT;
     76            _ISR_Enable( level );
     77            _Thread_Unblock( the_thread );
     78        }
    7179      }
     80      else {
     81        _ISR_Enable( level );
     82      }
     83
    7284      _Thread_Unnest_dispatch();
    7385      break;
    7486  }