From 4e9ee2257143af85069b3acaf386da50a67c5745 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sat, 21 Jul 2012 05:09:45 +0200 Subject: [PATCH] set_tid_address.2: Some rewordings and minor clarifications Signed-off-by: Michael Kerrisk --- man2/set_tid_address.2 | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/man2/set_tid_address.2 b/man2/set_tid_address.2 index c3e272d1d..d1adc0dbb 100644 --- a/man2/set_tid_address.2 +++ b/man2/set_tid_address.2 @@ -70,15 +70,19 @@ sets the value for the calling process to .IR tidptr . .LP -When +When a process whose .I clear_child_tid -is set, and the process exits, and the process was sharing memory -with other processes or threads, then 0 is written at this address, -and a -.I futex(child_tidptr, FUTEX_WAKE, 1, NULL, NULL, 0); -call is done. -(That is, wake a single process waiting on this futex.) -Errors are ignored. +is not NULL terminates, then, +if the process is sharing memory with other processes or threads, +then 0 is written at the address specified in +.I clear_child_tid +and the kernel performs the following operation: + + futex(clear_child_tid, FUTEX_WAKE, 1, NULL, NULL, 0); + +The effect of this operation is to wake a single process that +is performing a futex wait on the memory location. +Errors from the futex wake operation are ignored. .SH "RETURN VALUE" .BR set_tid_address () always returns the PID of the calling process.