mirror of https://github.com/mkerrisk/man-pages
set_tid_address.2: Use "thread" rather than "process" in DESCRIPTION
Reported-by: Rich Felker <dalias@libc.org> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
b701f72de4
commit
b5693a3854
|
@ -32,14 +32,14 @@ set_tid_address \- set pointer to thread ID
|
|||
.BI "long set_tid_address(int *" tidptr );
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
For each process, the kernel maintains two attributes (addresses) called
|
||||
For each thread, the kernel maintains two attributes (addresses) called
|
||||
.I set_child_tid
|
||||
and
|
||||
.IR clear_child_tid .
|
||||
These two attributes contain the value NULL by default.
|
||||
.TP
|
||||
.I set_child_tid
|
||||
If a process is started using
|
||||
If a thread is started using
|
||||
.BR clone (2)
|
||||
with the
|
||||
.B CLONE_CHILD_SETTID
|
||||
|
@ -51,11 +51,11 @@ argument of that system call.
|
|||
.IP
|
||||
When
|
||||
.I set_child_tid
|
||||
is set, the very first thing the new process does
|
||||
is writing its PID at this address.
|
||||
is set, the very first thing the new thread does
|
||||
is to write its thread ID at this address.
|
||||
.TP
|
||||
.I clear_child_tid
|
||||
If a process is started using
|
||||
If a thread is started using
|
||||
.BR clone (2)
|
||||
with the
|
||||
.B CLONE_CHILD_CLEARTID
|
||||
|
@ -69,25 +69,25 @@ The system call
|
|||
.BR set_tid_address ()
|
||||
sets the
|
||||
.I clear_child_tid
|
||||
value for the calling process to
|
||||
value for the calling thread to
|
||||
.IR tidptr .
|
||||
.LP
|
||||
When a process whose
|
||||
When a thread whose
|
||||
.I clear_child_tid
|
||||
is not NULL terminates, then,
|
||||
if the process is sharing memory with other processes or threads,
|
||||
if the thread is sharing memory with other 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
|
||||
The effect of this operation is to wake a single thread 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.
|
||||
always returns the caller's thread ID.
|
||||
.SH ERRORS
|
||||
.BR set_tid_address ()
|
||||
always succeeds.
|
||||
|
|
Loading…
Reference in New Issue