woops_ wrote on Friday, August 22, 2008:
How about you suspend the scheduler, put the thing to sleep, when you wake up due to interrupt do any manual clean up necessary, then unsuspend the scheduler.
or
Raise your priority to highest, put the thing to sleep, when you wake up doe to interrupt do any manual clean up necessary, then set priority back down.
either way you want to ensure the task that runs first after wake up is the task that was running when sleep was entered.