X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fkern%2Fsignal.c;h=948d68f1d814c687e8edb805b047da4596975242;hb=84c1846c483f7ddad5804c555c7e0d207f8d1ddc;hp=3e882cef168775f53367cf0561195bdfd9587495;hpb=96d6a1875e38ea878e1f1072683b6a471f1545ff;p=bertos.git diff --git a/bertos/kern/signal.c b/bertos/kern/signal.c index 3e882cef..948d68f1 100644 --- a/bertos/kern/signal.c +++ b/bertos/kern/signal.c @@ -136,11 +136,13 @@ sigmask_t sig_wait(sigmask_t sigs) { sigmask_t result; cpuflags_t flags; - extern int preempt_forbid_cnt; /* Sleeping with IRQs disabled or preemption forbidden is illegal */ IRQ_ASSERT_ENABLED(); + + #if CONFIG_KERN_PREEMPT ASSERT(preempt_forbid_cnt == 0); + #endif /* * This is subtle: there's a race condition where a concurrent @@ -164,13 +166,13 @@ sigmask_t sig_wait(sigmask_t sigs) CurrentProcess->sig_wait = sigs; /* - * Go to sleep and proc_schedule() another process. + * Go to sleep and proc_switch() to another process. * - * We re-enable IRQs because proc_schedule() does not + * We re-enable IRQs because proc_switch() does not * guarantee to save and restore the interrupt mask. */ IRQ_RESTORE(flags); - proc_schedule(); + proc_switch(); IRQ_SAVE_DISABLE(flags); /*