Multithreaded Programming Guide

Exit Print View

Updated: July 2014
 
 

Getting the Thread-Specific Data Value

thr_getspecific(3C) stores the current value bound to key for the calling thread into the location pointed to by valuep. For POSIX threads, see pthread_getspecific Syntax.

thr_getspecific Syntax

#include <thread.h>

int thr_getspecific(thread_key_t key, void **valuep);

thr_getspecific Return Values

thr_getspecific() returns 0 if successful. When any of the following conditions is detected, thr_getspecific() fails and returns the corresponding value.

ENOMEM

Description: Insufficient memory is available to associate value with keyp.

EINVAL

Description: keyp is invalid.