diff options
author | Siddhesh Poyarekar <siddhesh@redhat.com> | 2013-03-19 14:28:03 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@redhat.com> | 2013-03-19 14:28:20 +0530 |
commit | d3cfc668a3988168ccd9342e46cd884da511367b (patch) | |
tree | f925366da899ed9f1b56fed1f9ee5274cce3aed1 /manual/threads.texi | |
parent | 6bcae14685204da833b3451e0636eb346b639d67 (diff) | |
download | glibc-d3cfc668a3988168ccd9342e46cd884da511367b.zip glibc-d3cfc668a3988168ccd9342e46cd884da511367b.tar.gz glibc-d3cfc668a3988168ccd9342e46cd884da511367b.tar.bz2 |
Rename nptl.texi to threads.texi
The manual and its file names are about interfaces and not the
implementation details.
Diffstat (limited to 'manual/threads.texi')
-rw-r--r-- | manual/threads.texi | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/manual/threads.texi b/manual/threads.texi new file mode 100644 index 0000000..9a1df1a --- /dev/null +++ b/manual/threads.texi @@ -0,0 +1,44 @@ +@node POSIX Threads +@c @node POSIX Threads, , Cryptographic Functions, Top +@chapter POSIX Threads +@c %MENU% POSIX Threads +@cindex pthreads + +This chapter describes the @glibcadj{} POSIX Thread implementation. + +@menu +* Thread-specific Data:: Support for creating and + managing thread-specific data +@end menu + +@node Thread-specific Data +@section Thread-specific Data + +The @glibcadj{} implements functions to allow users to create and manage +data specific to a thread. Such data may be destroyed at thread exit, +if a destructor is provided. The following functions are defined: + +@table @code + +@item int pthread_key_create (pthread_key_t *@var{key}, void (*@var{destructor})(void*)) +Create a thread-specific data key for the calling thread, referenced by +@var{key}. + +Objects declared with the C++11 @code{thread_local} keyword are destroyed +before thread-specific data, so they should not be used in thread-specific +data destructors or even as members of the thread-specific data, since the +latter is passed as an argument to the destructor function. + +@item int pthread_key_delete (pthread_key_t @var{key}) +Destroy the thread-specific data @var{key} in the calling thread. The +destructor for the thread-specific data is not called during destruction, nor +is it called during thread exit. + +@item void *pthread_getspecific (pthread_key_t @var{key}) +Return the thread-specific data associated with @var{key} in the calling +thread. + +@item int pthread_setspecific (pthread_key_t @var{key}, const void *@var{value}) +Associate the thread-specific @var{value} with @var{key} in the calling thread. + +@end table |