diff options
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 2ca64035c..374241c67 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -402,6 +402,7 @@ fake_volatile: #ifdef CONFIG_BSD_PROCESS_ACCT acct_process(code); #endif + task_lock(tsk); sem_exit(); __exit_mm(tsk); #if CONFIG_AP1000 @@ -414,6 +415,7 @@ fake_volatile: tsk->state = TASK_ZOMBIE; tsk->exit_code = code; exit_notify(); + task_unlock(tsk); #ifdef DEBUG_PROC_TREE audit_ptree(); #endif @@ -455,6 +457,7 @@ asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struc add_wait_queue(¤t->wait_chldexit,&wait); repeat: flag = 0; + current->state = TASK_INTERRUPTIBLE; read_lock(&tasklist_lock); for (p = current->p_cptr ; p ; p = p->p_osptr) { if (pid>0) { @@ -521,12 +524,12 @@ repeat: retval = -ERESTARTSYS; if (signal_pending(current)) goto end_wait4; - current->state=TASK_INTERRUPTIBLE; schedule(); goto repeat; } retval = -ECHILD; end_wait4: + current->state = TASK_RUNNING; remove_wait_queue(¤t->wait_chldexit,&wait); return retval; } |