Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Kernel v2.4.19 /kernel/exit.c

Filename:/kernel/exit.c
Lines Added:12
Lines Deleted:4
Also changed in: (Previous) 2.4.19-rc5-ac1  2.4.19-rc5  2.4.19-rc4  2.4.19-rc3-ac5  2.4.19-rc3-ac4  2.4.19-rc3-ac3 
(Following) 2.4.19-ac1  2.4.19-ac2  2.4.19-ac3  2.4.19-ac4  2.4.20-pre1-ac1  2.4.20-pre1-ac2 

Location
[  2.4.19
  [  kernel
     o  exit.c

Patch

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();
 


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.