summaryrefslogtreecommitdiff
path: root/src/kernel/ao_task.c
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2016-05-06 18:13:12 -0600
committerBdale Garbee <bdale@gag.com>2016-05-06 18:13:12 -0600
commit4c20fdfa543059739b756171b991d430789cded1 (patch)
treef39e6c729364211bf0570c459c37b576ecf9faa9 /src/kernel/ao_task.c
parente58dd78bcb749315f84168c83a74cf80851bf815 (diff)
parent2f0c977c747824d0798550ac64eceb1d66c50efd (diff)
Merge branch 'branch-1.6' into debian
Diffstat (limited to 'src/kernel/ao_task.c')
-rw-r--r--src/kernel/ao_task.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/kernel/ao_task.c b/src/kernel/ao_task.c
index 55e423bb..e430edc6 100644
--- a/src/kernel/ao_task.c
+++ b/src/kernel/ao_task.c
@@ -355,7 +355,6 @@ ao_yield(void) ao_arch_naked_define
*/
if (ao_cur_task->wchan == NULL)
ao_task_to_run_queue(ao_cur_task);
- ao_cur_task = NULL;
for (;;) {
ao_arch_memory_barrier();
if (!ao_list_is_empty(&run_queue))
@@ -425,6 +424,7 @@ ao_sleep(__xdata void *wchan)
void
ao_wakeup(__xdata void *wchan) __reentrant
{
+ ao_validate_cur_stack();
#if HAS_TASK_QUEUE
struct ao_task *sleep, *next;
struct ao_list *sleep_queue;
@@ -442,10 +442,12 @@ ao_wakeup(__xdata void *wchan) __reentrant
}
ao_arch_irqrestore(flags);
#else
+ {
uint8_t i;
for (i = 0; i < ao_num_tasks; i++)
if (ao_tasks[i]->wchan == wchan)
ao_tasks[i]->wchan = NULL;
+ }
#endif
ao_check_stack();
}