From ae4e094c4a24e01650dd2a141d70f2c6a5b503d3 Mon Sep 17 00:00:00 2001 From: Mihai Renea Date: Thu, 24 Oct 2024 09:37:22 +0200 Subject: [PATCH] core/cond.c: cond_wait() expect enabled interrupts --- core/cond.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/cond.c b/core/cond.c index 8ff45f4d7461..497956496987 100644 --- a/core/cond.c +++ b/core/cond.c @@ -34,13 +34,14 @@ void cond_init(cond_t *cond) void cond_wait(cond_t *cond, mutex_t *mutex) { - unsigned irqstate = irq_disable(); + assert(irq_is_enabled()); + irq_disable(); thread_t *me = thread_get_active(); mutex_unlock(mutex); sched_set_status(me, STATUS_COND_BLOCKED); thread_add_to_list(&cond->queue, me); - irq_restore(irqstate); + irq_enable(); thread_yield_higher(); /*