lkml.org 
[lkml]   [2008]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] do_wait reorganization
On 03/31, Roland McGrath wrote:
>
> I think it should look like this:
>
> {
> int ret = eligible_child(type, pid, options, p);
> if (ret <= 0)
> return ret;
>
> if (p->exit_state == EXIT_DEAD)
> return 0;
>
> /*
> * We don't reap group leaders with subthreads.
> */
> if (p->exit_state == EXIT_ZOMBIE && !delay_group_leader(p))
> return wait_task_zombie(p, options, infop, stat_addr, ru);
>
> /*
> * It's stopped or running now, so it might
> * later continue, exit, or stop again.
> */
> *retval = 0;
>
> if (task_is_stopped_or_traced(p))
> return wait_task_stopped(p, options, infop, stat_addr, ru);
>
> return wait_task_continued(p, options, infop, stat_addr, ru);
> }

I think you are right.

(BTW, you moved the "options & WHATEVER" checks into wait_task_xxx(),
I think this really makes the code more readable and maintainable).

Oleg.



\
 
 \ /
  Last update: 2008-03-31 23:11    [W:0.096 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site