summaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-08-08 18:54:49 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-08-08 18:54:49 +0000
commit5514f4babeeb3af00ee0c325e3cda7a562cc3d65 (patch)
treeedd733879cab73e41324a99ca5da7bc154c4196d /kernel/exit.c
parent6a9366db547e958e8c9bf8e1c13bcea6cb2bf393 (diff)
Merge with Linux 2.4.0-test6-pre4.
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 993ba31f3..3e95fe878 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -26,17 +26,20 @@ void release(struct task_struct * p)
{
if (p != current) {
#ifdef CONFIG_SMP
- int has_cpu;
-
/*
* Wait to make sure the process isn't on the
* runqueue (active on some other CPU still)
*/
- do {
+ for (;;) {
spin_lock_irq(&runqueue_lock);
- has_cpu = p->has_cpu;
+ if (!p->has_cpu)
+ break;
spin_unlock_irq(&runqueue_lock);
- } while (has_cpu);
+ do {
+ barrier();
+ } while (p->has_cpu);
+ }
+ spin_unlock_irq(&runqueue_lock);
#endif
atomic_dec(&p->user->processes);
free_uid(p->user);