From 074127b5eb6578e95561061de60f7ecaaa592694 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Thu, 17 Jul 2003 19:27:39 -0700 Subject: [PATCH] CLONE_STOPPED From: Ulrich Drepper CLONE_STOPPED: start a thread in a stopped state. Required for NTPL. --- kernel/fork.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'kernel') diff --git a/kernel/fork.c b/kernel/fork.c index 24cba7f5f25d..7c4c94b1a968 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1076,7 +1076,7 @@ long do_fork(unsigned long clone_flags, init_completion(&vfork); } - if (p->ptrace & PT_PTRACED) { + if ((p->ptrace & PT_PTRACED) || (clone_flags & CLONE_STOPPED)) { /* * We'll start up with an immediate SIGSTOP. */ @@ -1084,7 +1084,9 @@ long do_fork(unsigned long clone_flags, set_tsk_thread_flag(p, TIF_SIGPENDING); } - wake_up_forked_process(p); /* do this last */ + p->state = TASK_STOPPED; + if (!(clone_flags & CLONE_STOPPED)) + wake_up_forked_process(p); /* do this last */ ++total_forks; if (unlikely (trace)) { -- cgit v1.2.3