Changeset 107ce47b in rtems


Ignore:
Timestamp:
Feb 9, 1996, 2:30:42 PM (24 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
8c8a924
Parents:
6dae1c2d
Message:

new isr synchronization algorithm using a single enumerated set of states.

Files:
19 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/rtems/inline/event.inl

    r6dae1c2d r107ce47b  
    2424STATIC INLINE void _Event_Manager_initialization( void )
    2525{
    26   _Event_Sync = FALSE;
     26  _Event_Sync_state = EVENT_SYNC_SYNCHRONIZED;
    2727
    2828  /*
  • c/src/exec/rtems/inline/rtems/rtems/event.inl

    r6dae1c2d r107ce47b  
    2424STATIC INLINE void _Event_Manager_initialization( void )
    2525{
    26   _Event_Sync = FALSE;
     26  _Event_Sync_state = EVENT_SYNC_SYNCHRONIZED;
    2727
    2828  /*
  • c/src/exec/rtems/macros/event.inl

    r6dae1c2d r107ce47b  
    2525  do { \
    2626    \
    27     _Event_Sync = FALSE; \
     27    _Event_Sync_state = EVENT_SYNC_SYNCHRONIZED; \
    2828    \
    2929    /* \
  • c/src/exec/rtems/macros/rtems/rtems/event.inl

    r6dae1c2d r107ce47b  
    2525  do { \
    2626    \
    27     _Event_Sync = FALSE; \
     27    _Event_Sync_state = EVENT_SYNC_SYNCHRONIZED; \
    2828    \
    2929    /* \
  • c/src/exec/rtems/src/event.c

    r6dae1c2d r107ce47b  
    145145  ISR_Level          level;
    146146  RTEMS_API_Control  *api;
     147  Event_Sync_states   sync_state;
    147148
    148149  executing = _Thread_Executing;
     
    171172  }
    172173
    173   _Event_Sync       = TRUE;
    174174  _Event_Sync_state = EVENT_SYNC_NOTHING_HAPPENED;
    175175
     
    193193
    194194  _ISR_Disable( level );
    195   switch ( _Event_Sync_state ) {
     195
     196  sync_state = _Event_Sync_state;
     197  _Event_Sync_state = EVENT_SYNC_SYNCHRONIZED;
     198
     199  switch ( sync_state ) {
     200    case EVENT_SYNC_SYNCHRONIZED:
    196201    case EVENT_SYNC_NOTHING_HAPPENED:
    197       _Event_Sync = FALSE;
    198202      _ISR_Enable( level );
    199203      return;
     
    275279      }
    276280    }
    277     else if ( _Event_Sync == TRUE && _Thread_Is_executing( the_thread ) ) {
    278       if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
    279         api->pending_events = _Event_sets_Clear( pending_events,seized_events );
    280         *(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
    281         _Event_Sync_state = EVENT_SYNC_SATISFIED;
    282       }
     281
     282    switch ( _Event_Sync_state ) {
     283      case EVENT_SYNC_SYNCHRONIZED:
     284      case EVENT_SYNC_SATISFIED:
     285        break;
     286 
     287      case EVENT_SYNC_NOTHING_HAPPENED:
     288      case EVENT_SYNC_TIMEOUT:
     289        if ( !_Thread_Is_executing( the_thread ) )
     290          break;
     291
     292        if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
     293          api->pending_events =
     294               _Event_sets_Clear( pending_events,seized_events );
     295          *(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
     296          _Event_Sync_state = EVENT_SYNC_SATISFIED;
     297        }
     298        break;
    283299    }
    284300  }
     
    313329      break;
    314330    case OBJECTS_LOCAL:
    315       if ( _Event_Sync == TRUE && _Thread_Is_executing( the_thread ) ) {
     331      if ( _Event_Sync_state != EVENT_SYNC_SYNCHRONIZED &&
     332           _Thread_Is_executing( the_thread ) ) {
    316333        if ( _Event_Sync_state != EVENT_SYNC_SATISFIED )
    317334          _Event_Sync_state = EVENT_SYNC_TIMEOUT;
  • c/src/exec/score/headers/tqdata.h

    r6dae1c2d r107ce47b  
    4242 
    4343typedef enum {
     44  THREAD_QUEUE_SYNCHRONIZED,
    4445  THREAD_QUEUE_NOTHING_HAPPENED,
    4546  THREAD_QUEUE_TIMEOUT,
    4647  THREAD_QUEUE_SATISFIED
    47 }  Thread_queue_states;
     48}  Thread_queue_States;
    4849
    4950/*
     
    6061                                       /* priority discipline list       */
    6162  } Queues;
    62   boolean                  sync;       /* alloc/dealloc critical section */
    63   Thread_queue_states      sync_state; /* what happened while in sync    */
     63  Thread_queue_States      sync_state; /* alloc/dealloc critical section */
    6464  Thread_queue_Disciplines discipline; /* queue discipline               */
    6565  States_Control           state;      /* state of threads on Thread_q   */
  • c/src/exec/score/include/rtems/score/tqdata.h

    r6dae1c2d r107ce47b  
    4242 
    4343typedef enum {
     44  THREAD_QUEUE_SYNCHRONIZED,
    4445  THREAD_QUEUE_NOTHING_HAPPENED,
    4546  THREAD_QUEUE_TIMEOUT,
    4647  THREAD_QUEUE_SATISFIED
    47 }  Thread_queue_states;
     48}  Thread_queue_States;
    4849
    4950/*
     
    6061                                       /* priority discipline list       */
    6162  } Queues;
    62   boolean                  sync;       /* alloc/dealloc critical section */
    63   Thread_queue_states      sync_state; /* what happened while in sync    */
     63  Thread_queue_States      sync_state; /* alloc/dealloc critical section */
    6464  Thread_queue_Disciplines discipline; /* queue discipline               */
    6565  States_Control           state;      /* state of threads on Thread_q   */
  • c/src/exec/score/inline/rtems/score/tqdata.inl

    r6dae1c2d r107ce47b  
    6767)
    6868{
    69   the_thread_queue->sync = TRUE;
    7069  the_thread_queue->sync_state = THREAD_QUEUE_NOTHING_HAPPENED;
    7170}
  • c/src/exec/score/inline/tqdata.inl

    r6dae1c2d r107ce47b  
    6767)
    6868{
    69   the_thread_queue->sync = TRUE;
    7069  the_thread_queue->sync_state = THREAD_QUEUE_NOTHING_HAPPENED;
    7170}
  • c/src/exec/score/macros/rtems/score/tqdata.inl

    r6dae1c2d r107ce47b  
    5353#define _Thread_queue_Enter_critical_section( _the_thread_queue ) \
    5454  do { \
    55     (_the_thread_queue)->sync = TRUE; \
    5655    (_the_thread_queue)->sync_state = THREAD_QUEUE_NOTHING_HAPPENED; \
    5756  } while ( 0 )
  • c/src/exec/score/macros/tqdata.inl

    r6dae1c2d r107ce47b  
    5353#define _Thread_queue_Enter_critical_section( _the_thread_queue ) \
    5454  do { \
    55     (_the_thread_queue)->sync = TRUE; \
    5655    (_the_thread_queue)->sync_state = THREAD_QUEUE_NOTHING_HAPPENED; \
    5756  } while ( 0 )
  • c/src/exec/score/src/threadq.c

    r6dae1c2d r107ce47b  
    5656  the_thread_queue->discipline     = the_discipline;
    5757  the_thread_queue->timeout_status = timeout_status;
     58  the_thread_queue->sync_state     = THREAD_QUEUE_SYNCHRONIZED;
    5859
    5960  switch ( the_discipline ) {
     
    327328      the_thread_queue = the_thread->Wait.queue;
    328329
    329       if ( the_thread_queue->sync == TRUE && _Thread_Is_executing(the_thread)) {
     330      if ( the_thread_queue->sync_state != THREAD_QUEUE_SYNCHRONIZED &&
     331           _Thread_Is_executing( the_thread ) ) {
    330332        if ( the_thread_queue->sync_state != THREAD_QUEUE_SATISFIED )
    331333          the_thread_queue->sync_state = THREAD_QUEUE_TIMEOUT;
     
    363365)
    364366{
    365   ISR_Level level;
     367  ISR_Level            level;
     368  Thread_queue_States  sync_state;
    366369
    367370  _ISR_Disable( level );
    368371
    369   the_thread_queue->sync = FALSE;
    370 
    371   switch ( the_thread_queue->sync_state ) {
     372  sync_state = the_thread_queue->sync_state;
     373  the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
     374
     375  switch ( sync_state ) {
     376    case THREAD_QUEUE_SYNCHRONIZED:
     377      /*
     378       *  This should never happen.  It indicates that someone did not
     379       *  enter a thread queue critical section.
     380       */
     381      break;
     382
    372383    case THREAD_QUEUE_NOTHING_HAPPENED:
    373384      _Chain_Append_unprotected(
     
    450461
    451462    return the_thread;
    452   } else if ( the_thread_queue->sync &&
    453               the_thread_queue->sync_state != THREAD_QUEUE_SATISFIED ) {
    454     the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
    455     _ISR_Enable( level );
    456     return _Thread_Executing;
    457   } else {
    458     _ISR_Enable( level );
    459     return NULL;
    460   }
     463  }
     464
     465  switch ( the_thread_queue->sync_state ) {
     466    case THREAD_QUEUE_SYNCHRONIZED:
     467    case THREAD_QUEUE_SATISFIED:
     468      _ISR_Enable( level );
     469      return NULL;
     470
     471    case THREAD_QUEUE_NOTHING_HAPPENED:
     472    case THREAD_QUEUE_TIMEOUT:
     473      the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
     474      _ISR_Enable( level );
     475      return _Thread_Executing;
     476  }
     477  return NULL;                /* this is only to prevent warnings */
    461478}
    462479
     
    558575)
    559576{
    560   Priority_Control  search_priority;
    561   Thread_Control   *search_thread;
    562   ISR_Level         level;
    563   Chain_Control    *header;
    564   unsigned32        header_index;
    565   Chain_Node       *the_node;
    566   Chain_Node       *next_node;
    567   Chain_Node       *previous_node;
    568   Chain_Node       *search_node;
    569   Priority_Control  priority;
    570   States_Control    block_state;
     577  Priority_Control     search_priority;
     578  Thread_Control      *search_thread;
     579  ISR_Level            level;
     580  Chain_Control       *header;
     581  unsigned32           header_index;
     582  Chain_Node          *the_node;
     583  Chain_Node          *next_node;
     584  Chain_Node          *previous_node;
     585  Chain_Node          *search_node;
     586  Priority_Control     priority;
     587  States_Control       block_state;
     588  Thread_queue_States  sync_state;
    571589
    572590  _Chain_Initialize_empty( &the_thread->Wait.Block2n );
     
    606624  }
    607625
    608   the_thread_queue->sync = FALSE;
    609 
    610626  if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
    611     goto syncronize;
     627    goto synchronize;
     628
     629  the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
    612630
    613631  if ( priority == search_priority )
     
    651669  }
    652670
    653   the_thread_queue->sync = FALSE;
    654 
    655671  if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
    656     goto syncronize;
     672    goto synchronize;
     673
     674  the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
    657675
    658676  if ( priority == search_priority )
     
    682700  return;
    683701
    684 syncronize:
    685 
    686   switch ( the_thread_queue->sync_state ) {
     702synchronize:
     703
     704  sync_state = the_thread_queue->sync_state;
     705  the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
     706
     707  switch ( sync_state ) {
     708    case THREAD_QUEUE_SYNCHRONIZED:
     709      /*
     710       *  This should never happen.  It indicates that someone did not
     711       *  enter a thread queue critical section.
     712       */
     713      break;
     714 
    687715    case THREAD_QUEUE_NOTHING_HAPPENED:
    688716      /*
     
    739767)
    740768{
    741   unsigned32             index;
    742   ISR_Level              level;
    743   Thread_Control *the_thread;
     769  unsigned32      index;
     770  ISR_Level       level;
     771  Thread_Control *the_thread = NULL;  /* just to remove warnings */
    744772  Thread_Control *new_first_thread;
    745773  Chain_Node     *new_first_node;
     
    760788  }
    761789
    762   if ( the_thread_queue->sync &&
    763        the_thread_queue->sync_state != THREAD_QUEUE_SATISFIED ) {
    764     the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
    765     _ISR_Enable( level );
    766     return _Thread_Executing;
    767   }
    768 
    769   _ISR_Enable( level );
    770   return NULL;
     790  switch ( the_thread_queue->sync_state ) {
     791    case THREAD_QUEUE_SYNCHRONIZED:
     792    case THREAD_QUEUE_SATISFIED:
     793      _ISR_Enable( level );
     794      return NULL;
     795
     796    case THREAD_QUEUE_NOTHING_HAPPENED:
     797    case THREAD_QUEUE_TIMEOUT:
     798      the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
     799      _ISR_Enable( level );
     800      return _Thread_Executing;
     801  }
    771802
    772803dequeue:
  • cpukit/rtems/inline/rtems/rtems/event.inl

    r6dae1c2d r107ce47b  
    2424STATIC INLINE void _Event_Manager_initialization( void )
    2525{
    26   _Event_Sync = FALSE;
     26  _Event_Sync_state = EVENT_SYNC_SYNCHRONIZED;
    2727
    2828  /*
  • cpukit/rtems/macros/rtems/rtems/event.inl

    r6dae1c2d r107ce47b  
    2525  do { \
    2626    \
    27     _Event_Sync = FALSE; \
     27    _Event_Sync_state = EVENT_SYNC_SYNCHRONIZED; \
    2828    \
    2929    /* \
  • cpukit/rtems/src/event.c

    r6dae1c2d r107ce47b  
    145145  ISR_Level          level;
    146146  RTEMS_API_Control  *api;
     147  Event_Sync_states   sync_state;
    147148
    148149  executing = _Thread_Executing;
     
    171172  }
    172173
    173   _Event_Sync       = TRUE;
    174174  _Event_Sync_state = EVENT_SYNC_NOTHING_HAPPENED;
    175175
     
    193193
    194194  _ISR_Disable( level );
    195   switch ( _Event_Sync_state ) {
     195
     196  sync_state = _Event_Sync_state;
     197  _Event_Sync_state = EVENT_SYNC_SYNCHRONIZED;
     198
     199  switch ( sync_state ) {
     200    case EVENT_SYNC_SYNCHRONIZED:
    196201    case EVENT_SYNC_NOTHING_HAPPENED:
    197       _Event_Sync = FALSE;
    198202      _ISR_Enable( level );
    199203      return;
     
    275279      }
    276280    }
    277     else if ( _Event_Sync == TRUE && _Thread_Is_executing( the_thread ) ) {
    278       if ( seized_events == event_condition || _Options_Is_any( option_set ) ) {
    279         api->pending_events = _Event_sets_Clear( pending_events,seized_events );
    280         *(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
    281         _Event_Sync_state = EVENT_SYNC_SATISFIED;
    282       }
     281
     282    switch ( _Event_Sync_state ) {
     283      case EVENT_SYNC_SYNCHRONIZED:
     284      case EVENT_SYNC_SATISFIED:
     285        break;
     286 
     287      case EVENT_SYNC_NOTHING_HAPPENED:
     288      case EVENT_SYNC_TIMEOUT:
     289        if ( !_Thread_Is_executing( the_thread ) )
     290          break;
     291
     292        if ( seized_events == event_condition || _Options_Is_any(option_set) ) {
     293          api->pending_events =
     294               _Event_sets_Clear( pending_events,seized_events );
     295          *(rtems_event_set *)the_thread->Wait.return_argument = seized_events;
     296          _Event_Sync_state = EVENT_SYNC_SATISFIED;
     297        }
     298        break;
    283299    }
    284300  }
     
    313329      break;
    314330    case OBJECTS_LOCAL:
    315       if ( _Event_Sync == TRUE && _Thread_Is_executing( the_thread ) ) {
     331      if ( _Event_Sync_state != EVENT_SYNC_SYNCHRONIZED &&
     332           _Thread_Is_executing( the_thread ) ) {
    316333        if ( _Event_Sync_state != EVENT_SYNC_SATISFIED )
    317334          _Event_Sync_state = EVENT_SYNC_TIMEOUT;
  • cpukit/score/include/rtems/score/tqdata.h

    r6dae1c2d r107ce47b  
    4242 
    4343typedef enum {
     44  THREAD_QUEUE_SYNCHRONIZED,
    4445  THREAD_QUEUE_NOTHING_HAPPENED,
    4546  THREAD_QUEUE_TIMEOUT,
    4647  THREAD_QUEUE_SATISFIED
    47 }  Thread_queue_states;
     48}  Thread_queue_States;
    4849
    4950/*
     
    6061                                       /* priority discipline list       */
    6162  } Queues;
    62   boolean                  sync;       /* alloc/dealloc critical section */
    63   Thread_queue_states      sync_state; /* what happened while in sync    */
     63  Thread_queue_States      sync_state; /* alloc/dealloc critical section */
    6464  Thread_queue_Disciplines discipline; /* queue discipline               */
    6565  States_Control           state;      /* state of threads on Thread_q   */
  • cpukit/score/inline/rtems/score/tqdata.inl

    r6dae1c2d r107ce47b  
    6767)
    6868{
    69   the_thread_queue->sync = TRUE;
    7069  the_thread_queue->sync_state = THREAD_QUEUE_NOTHING_HAPPENED;
    7170}
  • cpukit/score/macros/rtems/score/tqdata.inl

    r6dae1c2d r107ce47b  
    5353#define _Thread_queue_Enter_critical_section( _the_thread_queue ) \
    5454  do { \
    55     (_the_thread_queue)->sync = TRUE; \
    5655    (_the_thread_queue)->sync_state = THREAD_QUEUE_NOTHING_HAPPENED; \
    5756  } while ( 0 )
  • cpukit/score/src/threadq.c

    r6dae1c2d r107ce47b  
    5656  the_thread_queue->discipline     = the_discipline;
    5757  the_thread_queue->timeout_status = timeout_status;
     58  the_thread_queue->sync_state     = THREAD_QUEUE_SYNCHRONIZED;
    5859
    5960  switch ( the_discipline ) {
     
    327328      the_thread_queue = the_thread->Wait.queue;
    328329
    329       if ( the_thread_queue->sync == TRUE && _Thread_Is_executing(the_thread)) {
     330      if ( the_thread_queue->sync_state != THREAD_QUEUE_SYNCHRONIZED &&
     331           _Thread_Is_executing( the_thread ) ) {
    330332        if ( the_thread_queue->sync_state != THREAD_QUEUE_SATISFIED )
    331333          the_thread_queue->sync_state = THREAD_QUEUE_TIMEOUT;
     
    363365)
    364366{
    365   ISR_Level level;
     367  ISR_Level            level;
     368  Thread_queue_States  sync_state;
    366369
    367370  _ISR_Disable( level );
    368371
    369   the_thread_queue->sync = FALSE;
    370 
    371   switch ( the_thread_queue->sync_state ) {
     372  sync_state = the_thread_queue->sync_state;
     373  the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
     374
     375  switch ( sync_state ) {
     376    case THREAD_QUEUE_SYNCHRONIZED:
     377      /*
     378       *  This should never happen.  It indicates that someone did not
     379       *  enter a thread queue critical section.
     380       */
     381      break;
     382
    372383    case THREAD_QUEUE_NOTHING_HAPPENED:
    373384      _Chain_Append_unprotected(
     
    450461
    451462    return the_thread;
    452   } else if ( the_thread_queue->sync &&
    453               the_thread_queue->sync_state != THREAD_QUEUE_SATISFIED ) {
    454     the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
    455     _ISR_Enable( level );
    456     return _Thread_Executing;
    457   } else {
    458     _ISR_Enable( level );
    459     return NULL;
    460   }
     463  }
     464
     465  switch ( the_thread_queue->sync_state ) {
     466    case THREAD_QUEUE_SYNCHRONIZED:
     467    case THREAD_QUEUE_SATISFIED:
     468      _ISR_Enable( level );
     469      return NULL;
     470
     471    case THREAD_QUEUE_NOTHING_HAPPENED:
     472    case THREAD_QUEUE_TIMEOUT:
     473      the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
     474      _ISR_Enable( level );
     475      return _Thread_Executing;
     476  }
     477  return NULL;                /* this is only to prevent warnings */
    461478}
    462479
     
    558575)
    559576{
    560   Priority_Control  search_priority;
    561   Thread_Control   *search_thread;
    562   ISR_Level         level;
    563   Chain_Control    *header;
    564   unsigned32        header_index;
    565   Chain_Node       *the_node;
    566   Chain_Node       *next_node;
    567   Chain_Node       *previous_node;
    568   Chain_Node       *search_node;
    569   Priority_Control  priority;
    570   States_Control    block_state;
     577  Priority_Control     search_priority;
     578  Thread_Control      *search_thread;
     579  ISR_Level            level;
     580  Chain_Control       *header;
     581  unsigned32           header_index;
     582  Chain_Node          *the_node;
     583  Chain_Node          *next_node;
     584  Chain_Node          *previous_node;
     585  Chain_Node          *search_node;
     586  Priority_Control     priority;
     587  States_Control       block_state;
     588  Thread_queue_States  sync_state;
    571589
    572590  _Chain_Initialize_empty( &the_thread->Wait.Block2n );
     
    606624  }
    607625
    608   the_thread_queue->sync = FALSE;
    609 
    610626  if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
    611     goto syncronize;
     627    goto synchronize;
     628
     629  the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
    612630
    613631  if ( priority == search_priority )
     
    651669  }
    652670
    653   the_thread_queue->sync = FALSE;
    654 
    655671  if ( the_thread_queue->sync_state != THREAD_QUEUE_NOTHING_HAPPENED )
    656     goto syncronize;
     672    goto synchronize;
     673
     674  the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
    657675
    658676  if ( priority == search_priority )
     
    682700  return;
    683701
    684 syncronize:
    685 
    686   switch ( the_thread_queue->sync_state ) {
     702synchronize:
     703
     704  sync_state = the_thread_queue->sync_state;
     705  the_thread_queue->sync_state = THREAD_QUEUE_SYNCHRONIZED;
     706
     707  switch ( sync_state ) {
     708    case THREAD_QUEUE_SYNCHRONIZED:
     709      /*
     710       *  This should never happen.  It indicates that someone did not
     711       *  enter a thread queue critical section.
     712       */
     713      break;
     714 
    687715    case THREAD_QUEUE_NOTHING_HAPPENED:
    688716      /*
     
    739767)
    740768{
    741   unsigned32             index;
    742   ISR_Level              level;
    743   Thread_Control *the_thread;
     769  unsigned32      index;
     770  ISR_Level       level;
     771  Thread_Control *the_thread = NULL;  /* just to remove warnings */
    744772  Thread_Control *new_first_thread;
    745773  Chain_Node     *new_first_node;
     
    760788  }
    761789
    762   if ( the_thread_queue->sync &&
    763        the_thread_queue->sync_state != THREAD_QUEUE_SATISFIED ) {
    764     the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
    765     _ISR_Enable( level );
    766     return _Thread_Executing;
    767   }
    768 
    769   _ISR_Enable( level );
    770   return NULL;
     790  switch ( the_thread_queue->sync_state ) {
     791    case THREAD_QUEUE_SYNCHRONIZED:
     792    case THREAD_QUEUE_SATISFIED:
     793      _ISR_Enable( level );
     794      return NULL;
     795
     796    case THREAD_QUEUE_NOTHING_HAPPENED:
     797    case THREAD_QUEUE_TIMEOUT:
     798      the_thread_queue->sync_state = THREAD_QUEUE_SATISFIED;
     799      _ISR_Enable( level );
     800      return _Thread_Executing;
     801  }
    771802
    772803dequeue:
Note: See TracChangeset for help on using the changeset viewer.