[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/tosthreads/system TinyThreadSchedulerP.nc, 1.6, 1.7
Kevin Klues
klueska at users.sourceforge.net
Tue Oct 21 21:45:14 PDT 2008
Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/tosthreads/system
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21110/system
Modified Files:
TinyThreadSchedulerP.nc
Log Message:
optimization to join wakeup
Index: TinyThreadSchedulerP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/tosthreads/system/TinyThreadSchedulerP.nc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TinyThreadSchedulerP.nc 22 Oct 2008 03:22:27 -0000 1.6
--- TinyThreadSchedulerP.nc 22 Oct 2008 04:45:12 -0000 1.7
***************
*** 147,150 ****
--- 147,163 ----
}
+ void wakeupJoined(thread_t* t) {
+ int i,j,k;
+ k = 0;
+ for(i=0; i<sizeof(t->joinedOnMe); i++) {
+ for(j=0; j<8; j++) {
+ if(t->joinedOnMe[i] & 0x1)
+ call ThreadScheduler.wakeupThread(k);
+ t->joinedOnMe[i] >>= 1;
+ k++;
+ }
+ }
+ }
+
/* stop
* This routine stops a thread by putting it into the inactive state
***************
*** 153,163 ****
*/
void stop(thread_t* t) {
- int i;
t->state = TOSTHREAD_STATE_INACTIVE;
num_runnable_threads--;
! for(i=0; i<TOSTHREAD_MAX_NUM_THREADS; i++) {
! if(call BitArrayUtils.getBit(t->joinedOnMe, i))
! call ThreadScheduler.wakeupThread(i);
! }
#ifdef TOSTHREADS_TIMER_OPTIMIZATION
post alarmTask();
--- 166,172 ----
*/
void stop(thread_t* t) {
t->state = TOSTHREAD_STATE_INACTIVE;
num_runnable_threads--;
! wakeupJoined(t);
#ifdef TOSTHREADS_TIMER_OPTIMIZATION
post alarmTask();
More information about the Tinyos-2-commits
mailing list