X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=kernel%2Fkthread.c;h=c848b20b2b083edb517e3b3423e606222e5d331d;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=c18d7c731d57a4e8f6d2ebee03eb32227e8e2e3c;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/kernel/kthread.c b/kernel/kthread.c index c18d7c731..c848b20b2 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -12,7 +12,6 @@ #include #include #include -#include #include /* @@ -42,7 +41,7 @@ struct kthread_stop_info /* Thread stopping is done by setthing this var: lock serializes * multiple kthread_stop calls. */ -static DEFINE_MUTEX(kthread_stop_lock); +static DECLARE_MUTEX(kthread_stop_lock); static struct kthread_stop_info kthread_stop_info; int kthread_should_stop(void) @@ -115,9 +114,7 @@ static void keventd_create_kthread(void *_create) create->result = ERR_PTR(pid); } else { wait_for_completion(&create->started); - read_lock(&tasklist_lock); create->result = find_task_by_real_pid(pid); - read_unlock(&tasklist_lock); } complete(&create->done); } @@ -176,7 +173,7 @@ int kthread_stop_sem(struct task_struct *k, struct semaphore *s) { int ret; - mutex_lock(&kthread_stop_lock); + down(&kthread_stop_lock); /* It could exit after stop_info.k set, but before wake_up_process. */ get_task_struct(k); @@ -197,7 +194,7 @@ int kthread_stop_sem(struct task_struct *k, struct semaphore *s) wait_for_completion(&kthread_stop_info.done); kthread_stop_info.k = NULL; ret = kthread_stop_info.err; - mutex_unlock(&kthread_stop_lock); + up(&kthread_stop_lock); return ret; }