summaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 988e232..63d8295 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -678,10 +678,9 @@ static void exit_mm(struct task_struct * tsk)
down_read(&mm->mmap_sem);
if (mm->core_state) {
up_read(&mm->mmap_sem);
- down_write(&mm->mmap_sem);
- if (!--mm->core_state->nr_threads)
+
+ if (atomic_dec_and_test(&mm->core_state->nr_threads))
complete(&mm->core_state->startup);
- up_write(&mm->mmap_sem);
wait_for_completion(&mm->core_done);
down_read(&mm->mmap_sem);
OpenPOWER on IntegriCloud