NAME
kjb_pthread_key_create - Create a key for thread-specific data
SYNOPSIS
#include "l_mt/l_mt_pthread.h"
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-I/home/kobus/include
-L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
int kjb_pthread_key_create
(
kjb_pthread_key_t *key,
void (*destr_function)(void *)
);
DESCRIPTION
This tries to generate a key for thread-specific data. If successful,
each thread may use this key to access an associated void pointer.
The 'destr_function' pointer, if not equal to NULL, is a destructor function
called when the thread exits or is cancelled. The argument passed to the
destructor function is the thread's associated void pointer.
For example, very often the associated void pointer is a blob of memory
used by the thread, and the destr_function is equal to &free or
&kjb_mt_free.
The total number of allowable keys is limited to KJB_PTHREAD_KEYS_MAX.
This is less than PTHREAD_KEYS_MAX because the wrapper itself uses one key.
LOCK STATUS: no, this does not block
RETURNS
NO_ERROR, if successful. Otherwise, ERROR and a message is generated.
RELATED
kjb_pthread_getspecific, kjb_pthread_setspecific
kjb_pthread_key_delete, kjb_mt_free
DISCLAIMER
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.
AUTHOR
Andrew Predoehl
DOCUMENTER
Andrew Predoehl
SEE ALSO
kjb_pthread_create
,
kjb_pthread_mutex_lock
,
kjb_pthread_mutex_trylock
,
kjb_pthread_mutex_unlock
,
kjb_pthread_equal
,
get_kjb_pthread_self
,
kjb_pthread_exit
,
kjb_pthread_join
,
kjb_pthread_cancel
,
kjb_pthread_mutex_init
,
kjb_pthread_mutex_destroy
,
kjb_multithread_wrapper_serialization_lock
,
kjb_multithread_wrapper_serialization_unlock
,
kjb_pthread_key_delete
,
kjb_pthread_setspecific
,
kjb_pthread_getspecific
,
kjb_pthread_once
,
kjb_pthread_read_prng_seeds
,
kjb_pthread_attr_init
,
kjb_pthread_attr_destroy
,
kjb_pthread_attr_setdetachstate
,
kjb_pthread_attr_getdetachstate
,
get_kjb_pthread_number
,
reset_kjb_pthread_counter