summaryrefslogtreecommitdiff
path: root/kernel/context.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 20:23:54 -0800
committerLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 20:23:54 -0800
commitad8dcf57e93e8e5f9b815e786da35ef03fc70f89 (patch)
treef3394afd32c183a41ccbc649859ad505c5e8c09c /kernel/context.c
parent4c7ed1860c0d21292284fb044c465ba00ce89b7f (diff)
v2.4.12 -> v2.4.12.1
- Trond Myklebust: deadlock checking in lockd server - Tim Waugh: fix up parport wrong #define - Christoph Hellwig: i2c update, ext2 cleanup - Al Viro: fix partition handling sanity check. - Trond Myklebust: make NFS use SLAB_NOFS, and not play games with PF_MEMALLOC - Ben Fennema: UDF update - Alan Cox: continued merging - Chris Mason: get /proc buffer memory sizes right after buf-in-page-cache
Diffstat (limited to 'kernel/context.c')
-rw-r--r--kernel/context.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/context.c b/kernel/context.c
index 9ae4b6010901..4fbd1924c833 100644
--- a/kernel/context.c
+++ b/kernel/context.c
@@ -19,6 +19,7 @@
#include <linux/init.h>
#include <linux/unistd.h>
#include <linux/signal.h>
+#include <linux/completion.h>
static DECLARE_TASK_QUEUE(tq_context);
static DECLARE_WAIT_QUEUE_HEAD(context_task_wq);
@@ -63,7 +64,7 @@ int schedule_task(struct tq_struct *task)
return ret;
}
-static int context_thread(void *dummy)
+static int context_thread(void *startup)
{
struct task_struct *curtask = current;
DECLARE_WAITQUEUE(wait, curtask);
@@ -79,6 +80,8 @@ static int context_thread(void *dummy)
recalc_sigpending(curtask);
spin_unlock_irq(&curtask->sigmask_lock);
+ complete((struct completion *)startup);
+
/* Install a handler so SIGCLD is delivered */
sa.sa.sa_handler = SIG_IGN;
sa.sa.sa_flags = 0;
@@ -150,7 +153,10 @@ void flush_scheduled_tasks(void)
int start_context_thread(void)
{
- kernel_thread(context_thread, NULL, CLONE_FS | CLONE_FILES);
+ static struct completion startup __initdata = COMPLETION_INITIALIZER(startup);
+
+ kernel_thread(context_thread, &startup, CLONE_FS | CLONE_FILES);
+ wait_for_completion(&startup);
return 0;
}