This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] pthread_once: Use futex wrappers with error checking.
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Torvald Riegel <triegel at redhat dot com>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Thu, 4 Dec 2014 16:36:47 -0800 (PST)
- Subject: Re: [PATCH 2/2] pthread_once: Use futex wrappers with error checking.
- Authentication-results: sourceware.org; auth=none
- References: <1417726487 dot 22797 dot 48 dot camel at triegel dot csb> <1417726635 dot 22797 dot 50 dot camel at triegel dot csb>
> - /* 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.
Thanks,
Roland