From ad8dcf57e93e8e5f9b815e786da35ef03fc70f89 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 4 Feb 2002 20:23:54 -0800 Subject: 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 --- kernel/context.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'kernel/context.c') 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 #include #include +#include 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; } -- cgit v1.2.3