aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/src/chschd.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/kernel/src/chschd.c')
-rw-r--r--os/kernel/src/chschd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c
index 808e06300..9739a595b 100644
--- a/os/kernel/src/chschd.c
+++ b/os/kernel/src/chschd.c
@@ -127,10 +127,12 @@ void chSchGoSleepS(tstate_t newstate) {
static void wakeup(void *p) {
Thread *tp = (Thread *)p;
+ chSysLockFromIsr();
switch (tp->p_state) {
case THD_STATE_READY:
/* Handling the special case where the thread has been made ready by
another thread with higher priority.*/
+ chSysUnlockFromIsr();
return;
#if CH_USE_SEMAPHORES || CH_USE_QUEUES || \
(CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT)
@@ -151,6 +153,7 @@ static void wakeup(void *p) {
}
tp->p_u.rdymsg = RDY_TIMEOUT;
chSchReadyI(tp);
+ chSysUnlockFromIsr();
}
/**