X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fkern%2Fsignal.c;h=2f72c47906d6bf74899a55a03bedc63bd9912064;hb=245f240a4720c5b2f582842a1cd773dafd8c9f97;hp=37a37a255196d5655ee35ce45273932a54c81475;hpb=6a3c9d13073fcab59f86255408e5371804d5d455;p=bertos.git diff --git a/bertos/kern/signal.c b/bertos/kern/signal.c index 37a37a25..2f72c479 100644 --- a/bertos/kern/signal.c +++ b/bertos/kern/signal.c @@ -75,9 +75,7 @@ *
  * - Synchronous-signal delivery:
  *
- *     P1__                                   __P2
- *         \                                 /
- *          \__sig_send()____proc_wakeup()__/
+ *     [P1]____sig_send()____proc_wakeup()____[P2]
  * 
* * In the asynchronous case, the process is scheduled for execution as a @@ -87,9 +85,7 @@ *
  * - Asynchronous-signal delivery:
  *
- *     P1__                  __P1__                       __P2
- *         \                /      \                     /
- *          \__sig_post()__/        \__proc_schedule()__/
+ *     [P1]____sig_post()____[P1]____proc_schedule()____[P2]
  * 
* * In this way, any execution context, including an interrupt handler, can @@ -126,7 +122,6 @@ * - Do not call system functions that may implicitly sleep, such as * timer_delayTicks(). * - * \version $Id$ * \author Bernie Innocenti */ @@ -255,9 +250,6 @@ INLINE void __sig_signal(Process *proc, sigmask_t sigs, bool wakeup) { cpu_flags_t flags; - if (UNLIKELY(proc == current_process)) - return; - IRQ_SAVE_DISABLE(flags); /* Set the signals */ @@ -266,6 +258,8 @@ INLINE void __sig_signal(Process *proc, sigmask_t sigs, bool wakeup) /* Check if process needs to be awoken */ if (proc->sig_recv & proc->sig_wait) { + ASSERT(proc != current_process); + proc->sig_wait = 0; if (wakeup) proc_wakeup(proc);