| Kernel v2.4.19 /kernel/exit.c |
|---|
 2.4.19
 kernel
 exit.c
diff -urN linux-2.4.18/kernel/exit.c linux-2.4.19/kernel/exit.c
--- linux-2.4.18/kernel/exit.c Mon Feb 25 11:38:13 2002
+++ linux-2.4.19/kernel/exit.c Fri Aug 2 17:39:46 2002
@@ -12,6 +12,7 @@
#include <linux/completion.h>
#include <linux/personality.h>
#include <linux/tty.h>
+#include <linux/namespace.h>
#ifdef CONFIG_BSD_PROCESS_ACCT
#include <linux/acct.h>
#endif
@@ -151,7 +152,7 @@
/*
* When we die, we re-parent all our children.
- * Try to give them to another thread in our process
+ * Try to give them to another thread in our thread
* group, and if no such member exists, give it to
* the global child reaper process (ie "init")
*/
@@ -161,8 +162,14 @@
read_lock(&tasklist_lock);
- /* Next in our thread group */
- reaper = next_thread(father);
+ /* Next in our thread group, if they're not already exiting */
+ reaper = father;
+ do {
+ reaper = next_thread(reaper);
+ if (!(reaper->flags & PF_EXITING))
+ break;
+ } while (reaper != father);
+
if (reaper == father)
reaper = child_reaper;
@@ -316,7 +323,7 @@
mm_release();
if (mm) {
atomic_inc(&mm->mm_count);
- if (mm != tsk->active_mm) BUG();
+ BUG_ON(mm != tsk->active_mm);
/* more a memory barrier than a real lock */
task_lock(tsk);
tsk->mm = NULL;
@@ -452,6 +459,7 @@
sem_exit();
__exit_files(tsk);
__exit_fs(tsk);
+ exit_namespace(tsk);
exit_sighand(tsk);
exit_thread();
|