[PATCH 2/2] pthread_once: Use futex wrappers with error checking.
Torvald Riegel
triegel@redhat.com
Fri Dec 5 18:37:00 GMT 2014
On Thu, 2014-12-04 at 16:36 -0800, Roland McGrath wrote:
> > - /* Same generation, some other thread was faster. Wait. */
> > - lll_futex_wait (once_control, newval, LLL_PRIVATE);
> > + /* Same generation, some other thread was faster. Wait and
> > + retry. Ignore the return value because all possible
> > + values (0, -EWOULDBLOCK, -EINTR) need to be handled the
> > + same. */
>
> Two spaces between sentences, even when it was wrong before.
> Always mention EAGAIN rather than EWOULDBLOCK.
>
> Use ignore_value rather than only a comment, to be more explicit about a
> correct case of ignoring errors. Then we can use warn_unused_result on all
> the new inlines, and turn up cases where failing to check for errors is
> dubious (we have many today).
>
> Aside from those nits, this change is fine and good once we've settled on
> the new internal API details.
Updated patch attached. If there's no objection, and once we have
agreed on a Patch 1/2 that can be committed, I will commit this one as
well.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: futex-internal-pthread_once.patch
Type: text/x-patch
Size: 1924 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20141205/0b887552/attachment.bin>
More information about the Libc-alpha
mailing list