diff --git a/man2/futex.2 b/man2/futex.2 index bad616dc7..744eac286 100644 --- a/man2/futex.2 +++ b/man2/futex.2 @@ -91,9 +91,8 @@ blocking via a futex is an atomic compare-and-block operation. .\" a detailed specification of the synchronization semantics. One example use of futexes is implementing locks. -The state of the lock (i.e., -acquired or not acquired) can be represented as an atomically accessed -flag in shared memory. +The state of the lock (i.e., acquired or not acquired) +can be represented as an atomically accessed flag in shared memory. In the uncontended case, a thread can access or modify the lock state with atomic instructions, for example atomically changing it from not acquired to acquired @@ -255,8 +254,8 @@ architecture). This load, the comparison with the expected value, and starting to sleep are performed atomically and totally ordered with respect to other futex operations on the same futex word. -If the thread starts to -sleep, it is considered a waiter on this futex word. +If the thread starts to sleep, +it is considered a waiter on this futex word. If the futex value does not match .IR val , then the call fails immediately with the error @@ -264,8 +263,8 @@ then the call fails immediately with the error The purpose of the comparison with the expected value is to prevent lost wake-ups: If another thread changed the value of the futex word after the -calling thread decided to block based on the prior value, and if the other -thread executed a +calling thread decided to block based on the prior value, +and if the other thread executed a .BR FUTEX_WAKE operation (or similar wake-up) after the value change and before this .BR FUTEX_WAIT