aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/kthread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 3c677918d8f2..63d5a1f4cb93 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -661,12 +661,14 @@ int kthread_park(struct task_struct *k)
set_bit(KTHREAD_SHOULD_PARK, &kthread->flags);
if (k != current) {
+ test_and_set_tsk_thread_flag(k, TIF_NOTIFY_SIGNAL);
wake_up_process(k);
/*
* Wait for __kthread_parkme() to complete(), this means we
* _will_ have TASK_PARKED and are about to call schedule().
*/
wait_for_completion(&kthread->parked);
+ clear_tsk_thread_flag(k, TIF_NOTIFY_SIGNAL);
/*
* Now wait for that schedule() to complete and the task to
* get scheduled out.
@@ -704,8 +706,10 @@ int kthread_stop(struct task_struct *k)
kthread = to_kthread(k);
set_bit(KTHREAD_SHOULD_STOP, &kthread->flags);
kthread_unpark(k);
+ test_and_set_tsk_thread_flag(k, TIF_NOTIFY_SIGNAL);
wake_up_process(k);
wait_for_completion(&kthread->exited);
+ clear_tsk_thread_flag(k, TIF_NOTIFY_SIGNAL);
ret = kthread->result;
put_task_struct(k);