Multithreaded Programming Guide

thr_keycreate(3T)

thr_keycreate(3T) allocates a key that is used to identify thread-specific data in a process. (For POSIX threads, see "pthread_key_create(3T)".)

#include <thread.h>

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