]> git.neil.brown.name Git - history.git/commitdiff
Wake up a stopped task _after_ having marked the SIGCONT pending,
authorLinus Torvalds <torvalds@home.transmeta.com>
Sun, 9 Feb 2003 23:58:04 +0000 (15:58 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 9 Feb 2003 23:58:04 +0000 (15:58 -0800)
so that there isn't any window for running before the signal
handler has been invoced.

kernel/signal.c

index 63c16ac1a9fa92824abd67b5bc88bf4089ed39e6..a4d6618f77d06785f5cde986c28c4dfb0a722c44 100644 (file)
@@ -620,7 +620,6 @@ static void handle_stop_signal(int sig, struct task_struct *p)
                t = p;
                do {
                        rm_from_queue(SIG_KERNEL_STOP_MASK, &t->pending);
-                       wake_up_state(t, TASK_STOPPED);
                        
                        /*
                         * If there is a handler for SIGCONT, we must make
@@ -632,9 +631,13 @@ static void handle_stop_signal(int sig, struct task_struct *p)
                         * flag set, the thread will pause and acquire the
                         * siglock that we hold now and until we've queued
                         * the pending signal. 
+                        *
+                        * Wake up the stopped thread _after_ setting
+                        * TIF_SIGPENDING
                         */
                        if (!sigismember(&t->blocked, SIGCONT))
                                set_tsk_thread_flag(t, TIF_SIGPENDING);
+                       wake_up_state(t, TASK_STOPPED);
 
                        t = next_thread(t);
                } while (t != p);