diff options
| author | Andrew Morton <akpm@osdl.org> | 2003-07-17 19:27:39 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-07-17 19:27:39 -0700 |
| commit | 074127b5eb6578e95561061de60f7ecaaa592694 (patch) | |
| tree | d219051625594ca777807134b58820a6c4693492 /kernel | |
| parent | 7b17636cb9eb6d54b8812ac2a9859ed1f9e6ca48 (diff) | |
[PATCH] CLONE_STOPPED
From: Ulrich Drepper <drepper@redhat.com>
CLONE_STOPPED: start a thread in a stopped state. Required for NTPL.
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/fork.c | 6 |
1 files changed, 4 insertions, 2 deletions
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)) { |
