diff options
| author | Anton Altaparmakov <aia21@hera.kernel.org> | 2006-03-23 12:05:47 -0500 |
|---|---|---|
| committer | Anton Altaparmakov <aia21@hera.kernel.org> | 2006-03-23 12:05:47 -0500 |
| commit | a05ba4561fa3ad8b64a27577d0d38c190f60f762 (patch) | |
| tree | 5eb7561113e006b7bad0bef50dec6821962b1b36 /kernel/kthread.c | |
| parent | 74293759002aa7db0179158c20676a034614577b (diff) | |
| parent | b0e6e962992b76580f4900b166a337bad7c1e81b (diff) | |
Merge branch 'master' of /home/aia21/ntfs-2.6/
Diffstat (limited to 'kernel/kthread.c')
| -rw-r--r-- | kernel/kthread.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c index e75950a1092c..6a5373868a98 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. */ |
| 44 | static DECLARE_MUTEX(kthread_stop_lock); | 45 | static DEFINE_MUTEX(kthread_stop_lock); |
| 45 | static struct kthread_stop_info kthread_stop_info; | 46 | static struct kthread_stop_info kthread_stop_info; |
| 46 | 47 | ||
| 47 | int kthread_should_stop(void) | 48 | int 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 | } |
