thr_setspecific(3T) binds value to the thread-specific data key, key, for the calling thread. (For POSIX threads, see "pthread_setspecific(3T)".)
#include <thread.h> int thr_setspecific(thread_key_t key, void *value);