set thread-specific data
cc [options] -Kthread file
int thr_setspecific(thread_key_t key, void *value);
thr_setspecific associates a thread-specific value
Different threads can bind different values to the same key.
If the value bound to key
must be updated during the lifetime of the thread,
the caller must release the storage associated with the old value
before a new value is bound, or the storage is lost.
key to which value is to be bound
pointer to thread-specific data, or NULL
key is a key obtained with a previous
The effect of calling thr_setspecific with a key
value not obtained with thr_keycreate
or after key has been deleted with thr_keydelete
value is typically a pointer to blocks of dynamically-allocated memory
that have been reserved for use by the calling thread.
If value is NULL,
the calling thread will give up a non-NULL reference to key.
thr_setspecific returns zero for success
and an error number for failure.
If any of the following conditions is detected,
thr_setspecific returns the corresponding value:
The key value is invalid.
There is not sufficient memory available to establish the binding.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004