diff options
| author | Michael Kerrisk <mtk.manpages@gmail.com> | 2008-11-06 09:37:23 -0500 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2008-11-06 16:49:13 -0500 |
| commit | 84ee6c22e3163dd5c25fd15e59b55d1e509e01ee (patch) | |
| tree | 3f7fbe2a95d309ef0fdd848d18ea4819470a4e70 /man7/pthreads.7 | |
| parent | 3ba07ec78804f0a24098e0fc5e3199dfe7d14cbe (diff) | |
| download | man-pages-84ee6c22e3163dd5c25fd15e59b55d1e509e01ee.tar.gz | |
pthreads.7: Add a section describing thread IDs
In particular, note that in each pthreads function that takes
a thread ID argument, that ID by definition refers to a thread
in the same process as the caller.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man7/pthreads.7')
| -rw-r--r-- | man7/pthreads.7 | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/man7/pthreads.7 b/man7/pthreads.7 index 9c7644d4cc..1b4a3bb6c2 100644 --- a/man7/pthreads.7 +++ b/man7/pthreads.7 @@ -21,7 +21,7 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.TH PTHREADS 7 2008-10-16 "Linux" "Linux Programmer's Manual" +.TH PTHREADS 7 2008-11-07 "Linux" "Linux Programmer's Manual" .SH NAME pthreads \- POSIX threads .SH DESCRIPTION @@ -113,6 +113,20 @@ Note that the pthreads functions do not set For each of the pthreads functions that can return an error, POSIX.1-2001 specifies that the function can never fail with the error .BR EINTR . +.SS Thread IDs +Each of the threads in a process has a unique thread identifier +(stored in the type +.IR pthread_t ). +This identifier is returned to the caller of +.BR pthread_create (3), +and a thread can obtain its own thread identifier using +.BR pthread_self (3). +Thread IDs are only guaranteed to be unique within a process. +A thread ID may be reused after a terminated thread has been joined, +or a detached thread has terminated. +In all pthreads functions that accept a thread ID as an argument, +that ID by definition refers to a thread in +the same process as the caller. .SS "Thread-safe functions" A thread-safe function is one that can be safely (i.e., it will deliver the same results regardless of whether it is) |
