[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/tosthreads/system TinyThreadSchedulerP.nc, 1.7, 1.8

Kevin Klues klueska at users.sourceforge.net
Tue Oct 21 22:37:34 PDT 2008


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/tosthreads/system
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv23781/system

Modified Files:
	TinyThreadSchedulerP.nc 
Log Message:
Accidentally removed special casing the tosthread for wakeup and suspend so it doesnt get inserted in the ready queue.  Fixed now

Index: TinyThreadSchedulerP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/tosthreads/system/TinyThreadSchedulerP.nc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** TinyThreadSchedulerP.nc	22 Oct 2008 04:45:12 -0000	1.7
--- TinyThreadSchedulerP.nc	22 Oct 2008 05:37:32 -0000	1.8
***************
*** 33,37 ****
   * @author Kevin Klues <klueska at cs.stanford.edu>
   */
!  
  module TinyThreadSchedulerP {
    provides {
--- 33,37 ----
   * @author Kevin Klues <klueska at cs.stanford.edu>
   */
!   
  module TinyThreadSchedulerP {
    provides {
***************
*** 99,103 ****
        bool mt;
        atomic mt = (call ThreadQueue.isEmpty(&ready_queue) == TRUE);
!       if(!mt) break;
        call McuSleep.sleep();
      }
--- 99,103 ----
        bool mt;
        atomic mt = (call ThreadQueue.isEmpty(&ready_queue) == TRUE);
!       if(!mt || tos_thread->state == TOSTHREAD_STATE_READY) break;
        call McuSleep.sleep();
      }
***************
*** 111,115 ****
    void scheduleNextThread() {
      if(tos_thread->state == TOSTHREAD_STATE_READY)
!       current_thread = call ThreadQueue.remove(&ready_queue, tos_thread);
      else
        current_thread = call ThreadQueue.dequeue(&ready_queue);
--- 111,115 ----
    void scheduleNextThread() {
      if(tos_thread->state == TOSTHREAD_STATE_READY)
!       current_thread = tos_thread;
      else
        current_thread = call ThreadQueue.dequeue(&ready_queue);
***************
*** 262,266 ****
        if(current_thread->state == TOSTHREAD_STATE_ACTIVE) {
          current_thread->state = TOSTHREAD_STATE_READY;
!         call ThreadQueue.enqueue(&ready_queue, current_thread);
          interrupt(current_thread);
          return SUCCESS;
--- 262,267 ----
        if(current_thread->state == TOSTHREAD_STATE_ACTIVE) {
          current_thread->state = TOSTHREAD_STATE_READY;
!         if(current_thread != tos_thread)
!           call ThreadQueue.enqueue(&ready_queue, current_thread);
          interrupt(current_thread);
          return SUCCESS;
***************
*** 288,296 ****
      if((t->state) == TOSTHREAD_STATE_SUSPENDED) {
        t->state = TOSTHREAD_STATE_READY;
!       call ThreadQueue.enqueue(&ready_queue, call ThreadInfo.get[id]());
!       #ifdef TOSTHREADS_TIMER_OPTIMIZATION
!         atomic num_runnable_threads++;
!         post alarmTask();
!       #endif
        return SUCCESS;
      }
--- 289,299 ----
      if((t->state) == TOSTHREAD_STATE_SUSPENDED) {
        t->state = TOSTHREAD_STATE_READY;
!       if(t != tos_thread) {
!         call ThreadQueue.enqueue(&ready_queue, call ThreadInfo.get[id]());
!         #ifdef TOSTHREADS_TIMER_OPTIMIZATION
!           atomic num_runnable_threads++;
!           post alarmTask();
!         #endif
!       }
        return SUCCESS;
      }



More information about the Tinyos-2-commits mailing list