futex.2: Explain how to get equivalent of FUTEX_WAIT with an absolute timeout

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2016-06-24 10:20:40 +02:00
parent 678c99868e
commit 4100abc52e
1 changed files with 19 additions and 1 deletions

View File

@ -302,7 +302,6 @@ value change and will not start to sleep.
If the If the
.I timeout .I timeout
is not NULL, the structure it points to specifies a is not NULL, the structure it points to specifies a
.I relative
timeout for the wait. timeout for the wait.
(This interval will be rounded up to the system clock granularity, (This interval will be rounded up to the system clock granularity,
and is guaranteed not to expire early.) and is guaranteed not to expire early.)
@ -318,6 +317,25 @@ If
.I timeout .I timeout
is NULL, the call blocks indefinitely. is NULL, the call blocks indefinitely.
.IR Note :
for
.BR FUTEX_WAIT ,
.IR timeout
is interpreted as a
.IR relative
value.
This differs from other futex operations, where
.I timeout
is interpreted as an absolute value.
To obtain the equivalent of
.BR FUTEX_WAIT
with an absolute timeout, employ
.BR FUTEX_WAIT_BITSET
with
.IR val3
specified as
.BR FUTEX_BITSET_MATCH_ANY .
The arguments The arguments
.I uaddr2 .I uaddr2
and and