File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -299,6 +299,7 @@ extern _st_eventsys_t *_st_eventsys;
299299#define  _ST_DEL_IOQ (_pq )    ST_REMOVE_LINK(&_pq.links)
300300
301301#define  _ST_ADD_RUNQ (_thr )  ST_APPEND_LINK(&(_thr)->links, &_ST_RUNQ)
302+ #define  _ST_INSERT_RUNQ (_thr )  ST_INSERT_LINK(&(_thr)->links, &_ST_RUNQ)
302303#define  _ST_DEL_RUNQ (_thr )  ST_REMOVE_LINK(&(_thr)->links)
303304
304305#define  _ST_ADD_SLEEPQ (_thr , _timeout )  _st_add_sleep_q(_thr, _timeout)
Original file line number Diff line number Diff line change @@ -548,7 +548,8 @@ void _st_vp_check_clock(void)
548548        /* Make thread runnable */ 
549549        ST_ASSERT (!(thread -> flags  &  _ST_FL_IDLE_THREAD ));
550550        thread -> state  =  _ST_ST_RUNNABLE ;
551-         _ST_ADD_RUNQ (thread );
551+         // Insert at the head of RunQ, to execute timer first. 
552+         _ST_INSERT_RUNQ (thread );
552553    }
553554}
554555
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments