projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] bcm43xx: fix nrssi_threshold calculation.
[powerpc.git]
/
kernel
/
kthread.c
diff --git
a/kernel/kthread.c
b/kernel/kthread.c
index
e75950a
..
c5f3c66
100644
(file)
--- a/
kernel/kthread.c
+++ b/
kernel/kthread.c
@@
-12,6
+12,7
@@
#include <linux/unistd.h>
#include <linux/file.h>
#include <linux/module.h>
#include <linux/unistd.h>
#include <linux/file.h>
#include <linux/module.h>
+#include <linux/mutex.h>
#include <asm/semaphore.h>
/*
#include <asm/semaphore.h>
/*
@@
-41,7
+42,7
@@
struct kthread_stop_info
/* Thread stopping is done by setthing this var: lock serializes
* multiple kthread_stop calls. */
/* Thread stopping is done by setthing this var: lock serializes
* multiple kthread_stop calls. */
-static DE
CLAR
E_MUTEX(kthread_stop_lock);
+static DE
FIN
E_MUTEX(kthread_stop_lock);
static struct kthread_stop_info kthread_stop_info;
int kthread_should_stop(void)
static struct kthread_stop_info kthread_stop_info;
int kthread_should_stop(void)
@@
-114,7
+115,9
@@
static void keventd_create_kthread(void *_create)
create->result = ERR_PTR(pid);
} else {
wait_for_completion(&create->started);
create->result = ERR_PTR(pid);
} else {
wait_for_completion(&create->started);
+ read_lock(&tasklist_lock);
create->result = find_task_by_pid(pid);
create->result = find_task_by_pid(pid);
+ read_unlock(&tasklist_lock);
}
complete(&create->done);
}
}
complete(&create->done);
}
@@
-173,7
+176,7
@@
int kthread_stop_sem(struct task_struct *k, struct semaphore *s)
{
int ret;
{
int ret;
-
down
(&kthread_stop_lock);
+
mutex_lock
(&kthread_stop_lock);
/* It could exit after stop_info.k set, but before wake_up_process. */
get_task_struct(k);
/* It could exit after stop_info.k set, but before wake_up_process. */
get_task_struct(k);
@@
-194,7
+197,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;
wait_for_completion(&kthread_stop_info.done);
kthread_stop_info.k = NULL;
ret = kthread_stop_info.err;
-
up
(&kthread_stop_lock);
+
mutex_unlock
(&kthread_stop_lock);
return ret;
}
return ret;
}