Set correct programmer type.
[bertos.git] / bertos / kern / signal.c
index 37a37a255196d5655ee35ce45273932a54c81475..139e69da0274d4d0c1f3f2331a779a8fe36c9732 100644 (file)
@@ -75,9 +75,7 @@
  * <pre>
  * - Synchronous-signal delivery:
  *
- *     P1__                                   __P2
- *         \                                 /
- *          \__sig_send()____proc_wakeup()__/
+ *     [P1]____sig_send()____proc_wakeup()____[P2]
  * </pre>
  *
  * In the asynchronous case, the process is scheduled for execution as a
@@ -87,9 +85,7 @@
  * <pre>
  * - Asynchronous-signal delivery:
  *
- *     P1__                  __P1__                       __P2
- *         \                /      \                     /
- *          \__sig_post()__/        \__proc_schedule()__/
+ *     [P1]____sig_post()____[P1]____proc_schedule()____[P2]
  * </pre>
  *
  * In this way, any execution context, including an interrupt handler, can
@@ -255,9 +251,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 +259,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);