[PATCH] Add and use new glibc-internal futex API in sparc code.

Torvald Riegel triegel@redhat.com
Tue Jun 9 21:35:00 GMT 2015


On Tue, 2015-06-09 at 13:51 -0700, Roland McGrath wrote:
> Arguably every use of ignore_value should have a comment explaining why
> it's safe to elide the error checking.

That's always the same pattern.  Would it be okay for you if I just note
that pattern in the futex_wait comments?  Like so:

A common usage of futex_wait is to wait until a futex_word does not have
an expected value anymore:
  while (atomic_load_relaxed (&futex_word) == expected)
    ignore_value (futex_wait (&futex_word, expected, private));
In such a case, we continue waiting even if we were interrupted by a
signal (i.e., when futex_wait returned EINTR).  We could have also woken
up spuriously when 0 is returned by futex_wait, so it is easiest to just
check the value of the futex word to determine whether we need to keep
waiting.



More information about the Libc-alpha mailing list