aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kthread.c')
-rw-r--r--kernel/kthread.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c
index e75950a1092..6a5373868a9 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -12,6 +12,7 @@
12#include <linux/unistd.h> 12#include <linux/unistd.h>
13#include <linux/file.h> 13#include <linux/file.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/mutex.h>
15#include <asm/semaphore.h> 16#include <asm/semaphore.h>
16 17
17/* 18/*
@@ -41,7 +42,7 @@ struct kthread_stop_info
41 42
42/* Thread stopping is done by setthing this var: lock serializes 43/* Thread stopping is done by setthing this var: lock serializes
43 * multiple kthread_stop calls. */ 44 * multiple kthread_stop calls. */
44static DECLARE_MUTEX(kthread_stop_lock); 45static DEFINE_MUTEX(kthread_stop_lock);
45static struct kthread_stop_info kthread_stop_info; 46static struct kthread_stop_info kthread_stop_info;
46 47
47int kthread_should_stop(void) 48int kthread_should_stop(void)
@@ -173,7 +174,7 @@ int kthread_stop_sem(struct task_struct *k, struct semaphore *s)
173{ 174{
174 int ret; 175 int ret;
175 176
176 down(&kthread_stop_lock); 177 mutex_lock(&kthread_stop_lock);
177 178
178 /* It could exit after stop_info.k set, but before wake_up_process. */ 179 /* It could exit after stop_info.k set, but before wake_up_process. */
179 get_task_struct(k); 180 get_task_struct(k);
@@ -194,7 +195,7 @@ int kthread_stop_sem(struct task_struct *k, struct semaphore *s)
194 wait_for_completion(&kthread_stop_info.done); 195 wait_for_completion(&kthread_stop_info.done);
195 kthread_stop_info.k = NULL; 196 kthread_stop_info.k = NULL;
196 ret = kthread_stop_info.err; 197 ret = kthread_stop_info.err;
197 up(&kthread_stop_lock); 198 mutex_unlock(&kthread_stop_lock);
198 199
199 return ret; 200 return ret;
200} 201}