Obtains the thread-specific data associated with the specified key.
Syntax
pthread_getspecific(
key);
Argument Data Type Access
key opaque pthread_key_t read
C Binding
#include
void
*pthread_getspecific (
pthread_key_t key);
Arguments
- key
- Context key identifies the thread-specific data
to be obtained. This key must be obtained from pthread_key_create.
Description
This routine obtains the thread-specific data associated with
the specified key for the current thread. This function
returns the value currently bound to the specified key on
behalf of the calling thread.
This routine may be called from a thread-specific data destructor
function.
Return Values
No errors are returned. The function pthread_getspecific returns the
thread-specific data value associated with the given key.
If no thread-specific data value is associated with key,
or if key is not defined, then a NULL value is returned.
Associated Routines
pthread_key_create
pthread_setspecific
pthread_getspecific