Next: Non-POSIX Extensions, Up: POSIX Threads [Contents][Index]
The GNU C Library 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:
Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.
Create a thread-specific data key for the calling thread, referenced by key.
Objects declared with the C++11 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.
Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.
Destroy the thread-specific data key in the calling thread. The destructor for the thread-specific data is not called during destruction, nor is it called during thread exit.
Preliminary: | MT-Safe | AS-Safe | AC-Safe | See POSIX Safety Concepts.
Return the thread-specific data associated with key in the calling thread.
Preliminary: | MT-Safe | AS-Unsafe corrupt heap | AC-Unsafe corrupt mem | See POSIX Safety Concepts.
Associate the thread-specific value with key in the calling thread.