From: Oleg Nesterov A couple of small comments about how CLD_CONTINUED notification works. Signed-off-by: Oleg Nesterov Cc: Roland McGrath Signed-off-by: Andrew Morton --- kernel/signal.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff -puN kernel/signal.c~signals-document-cld_continued-notification-mechanics kernel/signal.c --- a/kernel/signal.c~signals-document-cld_continued-notification-mechanics +++ a/kernel/signal.c @@ -633,6 +633,11 @@ static int prepare_signal(int sig, struc why |= SIGNAL_CLD_STOPPED; if (why) { + /* + * The first thread which returns from finish_stop() + * will take ->siglock, notice SIGNAL_CLD_MASK, and + * notify its parent. See get_signal_to_deliver(). + */ signal->flags = why | SIGNAL_STOP_CONTINUED; signal->group_stop_count = 0; signal->group_exit_code = 0; @@ -1655,7 +1660,7 @@ relock: try_to_freeze(); spin_lock_irq(&sighand->siglock); - + /* see prepare_signal(SIGCONT) */ if (unlikely(signal->flags & SIGNAL_CLD_MASK)) { int why = (signal->flags & SIGNAL_STOP_CONTINUED) ? CLD_CONTINUED : CLD_STOPPED; _