headers: kobject.h redux
[cascardo/linux.git] / kernel / freezer.c
index bd1d42b..66ecd2e 100644 (file)
@@ -104,8 +104,13 @@ bool freeze_task(struct task_struct *p, bool sig_only)
        }
 
        if (should_send_signal(p)) {
-               if (!signal_pending(p))
-                       fake_signal_wake_up(p);
+               fake_signal_wake_up(p);
+               /*
+                * fake_signal_wake_up() goes through p's scheduler
+                * lock and guarantees that TASK_STOPPED/TRACED ->
+                * TASK_RUNNING transition can't race with task state
+                * testing in try_to_freeze_tasks().
+                */
        } else if (sig_only) {
                return false;
        } else {