Multithreaded Programming Guide

Create a Thread-Specific Data Key

Except for the function names and arguments, thread specific data is the same for Solaris as it is for POSIX. The synopses for the Solaris functions are given in this section. The functions are explained in "Create a Thread-Specific Data Key".

thr_keycreate(3T)

thr_keycreate() allocates a key that is used to identify thread-specific data in a process.

#include <thread.h>

int thr_keycreate(thread_key_t *keyp,
    void (*destructor) (void *value));