From 4100abc52e9cfc9b3c15deff58bd10baf9a91ed8 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Fri, 24 Jun 2016 10:20:40 +0200 Subject: [PATCH] futex.2: Explain how to get equivalent of FUTEX_WAIT with an absolute timeout Reviewed-by: Thomas Gleixner Signed-off-by: Michael Kerrisk --- man2/futex.2 | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/man2/futex.2 b/man2/futex.2 index 671b9edb9..d8e7eddea 100644 --- a/man2/futex.2 +++ b/man2/futex.2 @@ -302,7 +302,6 @@ value change and will not start to sleep. If the .I timeout is not NULL, the structure it points to specifies a -.I relative timeout for the wait. (This interval will be rounded up to the system clock granularity, and is guaranteed not to expire early.) @@ -318,6 +317,25 @@ If .I timeout 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 .I uaddr2 and