altos: Don't lose IRQ disabled state in ao_sleep
authorKeith Packard <keithp@keithp.com>
Sun, 17 Jun 2012 23:12:18 +0000 (16:12 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 17 Jun 2012 23:12:18 +0000 (16:12 -0700)
commit9d3fe2a80d0925e3eded6d738d05c5b4ea61504c
tree11ff8073f52a98fdd74ab9887f567c3a17a0d42a
parent4e6d96816e6604ee8d9bb49345a1c1211699a655
altos: Don't lose IRQ disabled state in ao_sleep

Using ao_arch_critical around the wchan setting will force interrupts
to be re-enabled before ao_yield records the state of that bit,
potentially causing problems with functions not atomically testing and
sleeping.

Tasks that need to set wchan with interrupts disabled should have
interrupts disabled when entering ao_sleep already.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/core/ao_task.c