[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


tis_setspecific

Sets the data value associated with the specified key.

Syntax

tis_setspecific(
                key,
                value );
 


Argument Data Type Access

key opaque pthread_key_t read value void * read


C Binding

#include 

int tis_setspecific ( pthread_key_t key, const void *value);

Arguments

key
Key that identifies the data to receive value. This key value must be obtained from tis_key_create.
value
New data value to associate with the specified key. Once set, this value can be retrieved using the same key in a call to tis_ getspecific.

Description

This routine sets the data value associated with the specified key. If a value is defined for the key (that is, the current value is not NULL), the new value is substituted for it. The key is obtained by a previous call to tis_key_create.

Do not call this routine from a data destructor function.

Return Values

If an error condition occurs, this routine returns an integer indicating the type of error. Possible return values are as follows:
Return        Description

0 Successful completion. [EINVAL] The key value is invalid. [ENOMEM] Insufficient memory exists to associate the value with the key.


Associated Routines

   tis_getspecific
   tis_key_create
   tis_key_delete



[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]