summaryrefslogtreecommitdiff
path: root/src/ao_task.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-11-26 17:39:40 -0800
committerKeith Packard <keithp@keithp.com>2010-12-22 20:39:40 -0800
commit484b44e81b655f1ecb48256095382a56d2839bae (patch)
tree14446271e5d92b9ea9bee040c7787ba48c616229 /src/ao_task.c
parent07213dc34fa20470a4b36a327a83d75b0f010ebb (diff)
altos: eliminate ao_wake_task
Waking up a task waiting on some random object is a bad idea. Fix the waiters to look for suitable signalling. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_task.c')
-rw-r--r--src/ao_task.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/ao_task.c b/src/ao_task.c
index 72c9d7d6..35f34b49 100644
--- a/src/ao_task.c
+++ b/src/ao_task.c
@@ -204,12 +204,11 @@ ao_sleep(__xdata void *wchan)
ao_cur_task->wchan = wchan;
}
ao_yield();
+ ao_cur_task->alarm = 0;
if (ao_cur_task->wchan) {
ao_cur_task->wchan = NULL;
- ao_cur_task->alarm = 0;
return 1;
}
- ao_cur_task->alarm = 0;
return 0;
}
@@ -234,12 +233,6 @@ ao_alarm(uint16_t delay)
}
void
-ao_wake_task(__xdata struct ao_task *task)
-{
- task->wchan = NULL;
-}
-
-void
ao_exit(void) __critical
{
uint8_t i;