lkml.org 
[lkml]   [2008]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/2] do_wait reorganization
Date
> 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


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