Sets the per-thread context associated with the specified key for the current thread.
pthread_setspecific(
                    key,
                    value );
 
Argument         Data Type               Access
key              opaque pthread_key_t    read
value            opaque pthread_addr_t   read
int pthread_setspecific ( pthread_key_t key, pthread_addr_t value);
Different threads can bind different values to the same key. These values are typically pointers to blocks of dynamically allocated memory that are reserved for use by the calling thread.
Return Error Description0 Successful completion. -1 [EINVAL] The key value is invalid.