Messages in this thread | | | From | Roland McGrath <> | Subject | Re: [PATCH 1/2] do_wait reorganization | Date | Sun, 30 Mar 2008 20:27:17 -0700 (PDT) |
| |
> I also wonder if you really need both "int *retval" and the return value. > Isn't "retval" always going to be zero or a negative errno?
No.
> And the return value is going to be either true of false?
Yes.
> Why not just fold them into one single thing: > > - negative: all done, with error > - zero: this didn't trigger, continue with the next one in caller > - positive: this thread triggered, all done, return 0 in the caller. > > which is (I think) close to what we already do in eligible_child() (so > this would not be a new calling convention for this particular code).
You listed the three possibilities for eligible_child(). For wait_consider_task(), there are four possibilities:
- all done, with error - this thread was not eligible, look for another; return -ECHILD if none ready - this thread was eligible but is not ready; return 0 or block if none ready - all done, this thread is ready; return its pid
I'll post another version that I think you'll like a little better.
Thanks, Roland
| |