From 83586a3d2e6b9eb24cce5b9ac20d81e1aff17370 Mon Sep 17 00:00:00 2001 From: Linus Torvalds <torvalds@home.transmeta.com> Date: Mon, 10 Feb 2003 19:05:34 -0800 Subject: [PATCH] If we set TIF_SIGPENDING for SIGCONT, we have to wake up any sleeping tasks (even if we don't otherwise need to wake anything up), since otherwise later signals would see that signals are already pending and wouldn't cause wakeups. --- kernel/signal.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/signal.c b/kernel/signal.c index a4d6618f77d0..b43102e63a8d 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -619,6 +619,7 @@ static void handle_stop_signal(int sig, struct task_struct *p) rm_from_queue(SIG_KERNEL_STOP_MASK, &p->signal->shared_pending); t = p; do { + unsigned int state; rm_from_queue(SIG_KERNEL_STOP_MASK, &t->pending); /* @@ -635,9 +636,12 @@ static void handle_stop_signal(int sig, struct task_struct *p) * Wake up the stopped thread _after_ setting * TIF_SIGPENDING */ - if (!sigismember(&t->blocked, SIGCONT)) + state = TASK_STOPPED; + if (!sigismember(&t->blocked, SIGCONT)) { set_tsk_thread_flag(t, TIF_SIGPENDING); - wake_up_state(t, TASK_STOPPED); + state |= TASK_INTERRUPTIBLE; + } + wake_up_state(t, state); t = next_thread(t); } while (t != p); -- 2.30.9