mirror of https://github.com/mkerrisk/man-pages
futex.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
63ad44cb92
commit
83e80dda44
|
@ -1583,11 +1583,14 @@ fwait(int *futexp)
|
|||
the GCC Manual. */
|
||||
|
||||
while (1) {
|
||||
|
||||
/* Is the futex available? */
|
||||
|
||||
if (__sync_bool_compare_and_swap(futexp, 1, 0))
|
||||
break; /* Yes */
|
||||
|
||||
/* Futex is not available; wait */
|
||||
|
||||
s = futex(futexp, FUTEX_WAIT, 0, NULL, NULL, 0);
|
||||
if (s == \-1 && errno != EAGAIN)
|
||||
errExit("futex\-FUTEX_WAIT");
|
||||
|
|
Loading…
Reference in New Issue