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

Kevin Klues klueska at users.sourceforge.net
Tue Oct 14 22:41:56 PDT 2008


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

Modified Files:
	TinyThreadSchedulerP.nc 
Log Message:
special cased the tosthread to reduce overhead in waking it up

Index: TinyThreadSchedulerP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/tosthreads/system/TinyThreadSchedulerP.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TinyThreadSchedulerP.nc	10 Oct 2008 06:27:03 -0000	1.3
--- TinyThreadSchedulerP.nc	15 Oct 2008 05:41:54 -0000	1.4
***************
*** 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);
***************
*** 267,273 ****
      if((t->state) == TOSTHREAD_STATE_SUSPENDED) {
        t->state = TOSTHREAD_STATE_READY;
!       call ThreadQueue.enqueue(&ready_queue, call ThreadInfo.get[id]());
!       atomic num_runnable_threads++;
!       post timerTask();
        return SUCCESS;
      }
--- 267,275 ----
      if((t->state) == TOSTHREAD_STATE_SUSPENDED) {
        t->state = TOSTHREAD_STATE_READY;
!       if(t != tos_thread) {
!         call ThreadQueue.enqueue(&ready_queue, call ThreadInfo.get[id]());
!         atomic num_runnable_threads++;
!         post timerTask();
!       }
        return SUCCESS;
      }



More information about the Tinyos-2-commits mailing list