thr_getspecific() stores the current value bound to key for the calling thread into the location pointed to by valuep.
#include <thread.h> int thr_getspecific(thread_key_t key, void **valuep);