This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]