Remove ENOSYS tests in libm-test.inc.
[glibc.git] / manual / threads.texi
blob9a1df1a8620fe747946db4e8afdcf8264b5e3378
1 @node POSIX Threads
2 @c @node POSIX Threads, , Cryptographic Functions, Top
3 @chapter POSIX Threads
4 @c %MENU% POSIX Threads
5 @cindex pthreads
7 This chapter describes the @glibcadj{} POSIX Thread implementation.
9 @menu
10 * Thread-specific Data::          Support for creating and
11                                   managing thread-specific data
12 @end menu
14 @node Thread-specific Data
15 @section Thread-specific Data
17 The @glibcadj{} implements functions to allow users to create and manage
18 data specific to a thread.  Such data may be destroyed at thread exit,
19 if a destructor is provided.  The following functions are defined:
21 @table @code
23 @item int pthread_key_create (pthread_key_t *@var{key}, void (*@var{destructor})(void*))
24 Create a thread-specific data key for the calling thread, referenced by
25 @var{key}.
27 Objects declared with the C++11 @code{thread_local} keyword are destroyed
28 before thread-specific data, so they should not be used in thread-specific
29 data destructors or even as members of the thread-specific data, since the
30 latter is passed as an argument to the destructor function.
32 @item int pthread_key_delete (pthread_key_t @var{key})
33 Destroy the thread-specific data @var{key} in the calling thread.  The
34 destructor for the thread-specific data is not called during destruction, nor
35 is it called during thread exit.
37 @item void *pthread_getspecific (pthread_key_t @var{key})
38 Return the thread-specific data associated with @var{key} in the calling
39 thread.
41 @item int pthread_setspecific (pthread_key_t @var{key}, const void *@var{value})
42 Associate the thread-specific @var{value} with @var{key} in the calling thread.
44 @end table