summaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-04-30 00:53:00 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 08:29:36 -0700
commit021e1ae3d85a76ce962a300c96813f04ae50c87c (patch)
tree1c3cfbf8151c339baa3b35a4a78fa50ccc7594ab /kernel/signal.c
parent7e695a5ef5c1c768d7feb75cc61e42f13d763623 (diff)
downloadop-kernel-dev-021e1ae3d85a76ce962a300c96813f04ae50c87c.zip
op-kernel-dev-021e1ae3d85a76ce962a300c96813f04ae50c87c.tar.gz
signals: document CLD_CONTINUED notification mechanics
A couple of small comments about how CLD_CONTINUED notification works. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 359c4de..8423867 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -633,6 +633,11 @@ static int prepare_signal(int sig, struct task_struct *p)
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;
@@ -1694,7 +1699,11 @@ relock:
try_to_freeze();
spin_lock_irq(&sighand->siglock);
-
+ /*
+ * Every stopped thread goes here after wakeup. Check to see if
+ * we should notify the parent, prepare_signal(SIGCONT) encodes
+ * the CLD_ si_code into SIGNAL_CLD_MASK bits.
+ */
if (unlikely(signal->flags & SIGNAL_CLD_MASK)) {
int why = (signal->flags & SIGNAL_STOP_CONTINUED)
? CLD_CONTINUED : CLD_STOPPED;
OpenPOWER on IntegriCloud