Changeset 0f63c86 in rtems


Ignore:
Timestamp:
Jun 10, 1996, 8:47:56 PM (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
893103c
Parents:
fdec30b
Message:

added code to _Thread_Clear_state to check if the state was not currently set.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/score/src/thread.c

    rfdec30b r0f63c86  
    719719 */
    720720
     721
    721722void _Thread_Clear_state(
    722723  Thread_Control *the_thread,
     
    724725)
    725726{
    726   ISR_Level level;
     727  ISR_Level       level;
     728  States_Control  current_state;
    727729
    728730  _ISR_Disable( level );
    729     the_thread->current_state =
    730       _States_Clear( state, the_thread->current_state );
    731 
    732     if ( _States_Is_ready( the_thread->current_state ) ) {
    733 
    734       _Priority_Add_to_bit_map( &the_thread->Priority_map );
    735 
    736       _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
    737 
    738       _ISR_Flash( level );
    739 
    740       if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
    741         _Thread_Heir = the_thread;
    742         if ( _Thread_Executing->is_preemptible ||
    743              the_thread->current_priority == 0 )
    744           _Context_Switch_necessary = TRUE;
     731    current_state = the_thread->current_state;
     732   
     733    if ( current_state & state ) {
     734      current_state =
     735      the_thread->current_state = _States_Clear( state, current_state );
     736
     737      if ( _States_Is_ready( current_state ) ) {
     738
     739        _Priority_Add_to_bit_map( &the_thread->Priority_map );
     740
     741        _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node);
     742
     743        _ISR_Flash( level );
     744
     745        if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
     746          _Thread_Heir = the_thread;
     747          if ( _Thread_Executing->is_preemptible ||
     748               the_thread->current_priority == 0 )
     749            _Context_Switch_necessary = TRUE;
     750        }
    745751      }
    746     }
     752  }
    747753  _ISR_Enable( level );
    748754}
  • cpukit/score/src/thread.c

    rfdec30b r0f63c86  
    719719 */
    720720
     721
    721722void _Thread_Clear_state(
    722723  Thread_Control *the_thread,
     
    724725)
    725726{
    726   ISR_Level level;
     727  ISR_Level       level;
     728  States_Control  current_state;
    727729
    728730  _ISR_Disable( level );
    729     the_thread->current_state =
    730       _States_Clear( state, the_thread->current_state );
    731 
    732     if ( _States_Is_ready( the_thread->current_state ) ) {
    733 
    734       _Priority_Add_to_bit_map( &the_thread->Priority_map );
    735 
    736       _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node );
    737 
    738       _ISR_Flash( level );
    739 
    740       if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
    741         _Thread_Heir = the_thread;
    742         if ( _Thread_Executing->is_preemptible ||
    743              the_thread->current_priority == 0 )
    744           _Context_Switch_necessary = TRUE;
     731    current_state = the_thread->current_state;
     732   
     733    if ( current_state & state ) {
     734      current_state =
     735      the_thread->current_state = _States_Clear( state, current_state );
     736
     737      if ( _States_Is_ready( current_state ) ) {
     738
     739        _Priority_Add_to_bit_map( &the_thread->Priority_map );
     740
     741        _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node);
     742
     743        _ISR_Flash( level );
     744
     745        if ( the_thread->current_priority < _Thread_Heir->current_priority ) {
     746          _Thread_Heir = the_thread;
     747          if ( _Thread_Executing->is_preemptible ||
     748               the_thread->current_priority == 0 )
     749            _Context_Switch_necessary = TRUE;
     750        }
    745751      }
    746     }
     752  }
    747753  _ISR_Enable( level );
    748754}
Note: See TracChangeset for help on using the changeset viewer.