Module: xenomai-forge
Branch: master
Commit: 65d3087ef847be2ca30fe22f3157e5dcda0415d3
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=65d3087ef847be2ca30fe22f3157e5dcda0415d3

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Mon Sep 23 13:23:53 2013 +0200

cobalt/posix/signal: Account for dequeued timer signals

If a timer is deleted, we remove potential pending events from the
signal queue of the receiver. But we do not (and cannot) clear
sigpending in this case. So account for the case the sigpending still
contains a signal event for which no queue element is present: fix up
sigpending and recheck the signal status.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 kernel/cobalt/posix/signal.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/kernel/cobalt/posix/signal.c b/kernel/cobalt/posix/signal.c
index aa37f50..882042d 100644
--- a/kernel/cobalt/posix/signal.c
+++ b/kernel/cobalt/posix/signal.c
@@ -214,6 +214,7 @@ static int signal_wait(sigset_t *set, xnticks_t timeout,
 
        xnlock_get_irqsave(&nklock, s);
 
+check:
        if (sigisemptyset(&curr->sigpending))
                /* Most common/fast path. */
                goto wait;
@@ -231,7 +232,10 @@ static int signal_wait(sigset_t *set, xnticks_t timeout,
 
        if (sig) {
                sigq = curr->sigqueues + sig - 1;
-               XENO_BUGON(COBALT, list_empty(sigq));
+               if (list_empty(sigq)) {
+                       sigdelset(&curr->sigpending, sig);
+                       goto check;
+               }
                sigp = list_get_entry(sigq, struct cobalt_sigpending, next);
                INIT_LIST_HEAD(&sigp->next); /* Mark sigp as unlinked. */
                if (list_empty(sigq))


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to