[PATCH 2/2] pthread_once: Use futex wrappers with error checking.

Roland McGrath roland@hack.frob.com
Fri Dec 5 00:36:00 GMT 2014


> -	      /* 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



More information about the Libc-alpha mailing list