next up previous contents index
Next: 18.3.30 pthread_key_delete: Delete a Up: 18.3 POSIX Threads Reference Previous: 18.3.28 pthread_join: Join with

18.3.29 pthread_key_create: Create a thread-specific data key

 

SYNOPSIS

#include <oskit/threads/pthread.h>

int pthread_key_create(pthread_ket_t *key, void (*destructor)(void *));

DESCRIPTION

Create a thread-specific key for use with pthread_setspecific. If specified, the destructor is called on any non-NULL key/value pair when a thread exits.

PARAMETERS

key
Address where the new key value should be stored.
destructor
Pointer to the destructor function, which may be NULL.

RETURNS

Returns zero on success, and stores the new key value at *key. Returns EAGAIN if the are no more keys available.

RELATED INFORMATION

pthread_key_delete, pthread_setspecific, pthread_getspecific



University of Utah Flux Research Group