X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=blobdiff_plain;f=tos%2Flib%2Ftosthreads%2Fsystem%2FThreadSleepP.nc;h=d78212d99aa729b7ee10410a1a3dbb60a288ef05;hp=65554cf0298b61291e3572adfd156570afcce5fe;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hpb=adf1de6c009d13b7b52e68535c63b28f59c97400 diff --git a/tos/lib/tosthreads/system/ThreadSleepP.nc b/tos/lib/tosthreads/system/ThreadSleepP.nc index 65554cf0..d78212d9 100644 --- a/tos/lib/tosthreads/system/ThreadSleepP.nc +++ b/tos/lib/tosthreads/system/ThreadSleepP.nc @@ -62,8 +62,20 @@ implementation { return SUCCESS; } + //Need to add a cancel command so that components like + //BlockingAMReceiverImplP can use the ThreadSleep interface + //directly instead of reusing the underlying ThreadTimerC + //component. The current implementation does things this way + //and causes us to be defensive in here since the same + //TimerMilli.fired() event is sent to that component as well. + //Basically its just broken.... cancel() would get rid of this. + + //Also need some sort of a sleepWithSyscall command + //Need to think about this one a little more + event void TimerMilli.fired[uint8_t id]() { thread_t* t = call ThreadScheduler.threadInfo(id); - call SystemCall.finish(t->syscall); + if(t->syscall->syscall_ptr == sleepTask) + call SystemCall.finish(t->syscall); } }