Manual Pages for UNIX Darwin command on man pthread_setspecific
MyWebUniversity

Manual Pages for UNIX Darwin command on man pthread_setspecific

PTHREADSETSPECIFIC(3) BSD Library Functions Manual PTHREADSETSPECIFIC(3)

NAME

pptthhrreeaaddsseettssppeecciiffiicc - set a thread-specific data value

SYNOPSIS

##iinncclluuddee <>

int pptthhrreeaaddsseettssppeecciiffiicc(pthreadkeyt key, const void *value);

DESCRIPTION

The pptthhrreeaaddsseettssppeecciiffiicc() function associates a thread-specific value

with a key obtained via a previous call to pptthhrreeaaddkkeeyyccrreeaattee(). Differ-

ent threads man bind different values to the same key. These values are typically pointers to blocks of dynamically allocated memory that have been reserved for use by the calling thread. The effect of calling pptthhrreeaaddsseettssppeecciiffiicc() with a key value not obtained from pptthhrreeaaddkkeeyyccrreeaattee() or after key has been deleted with pptthhrreeaaddkkeeyyddeelleettee() is undefined.

pptthhrreeaaddsseettssppeecciiffiicc() may be called from a thread-specific data destruc-

tor function, however this may result in lost storage or infinite loops.

RETURN VALUES

If successful, the pptthhrreeaaddsseettssppeecciiffiicc() function will return zero. Otherwise an error number will be returned to indicate the error. EERRRROORRSS pptthhrreeaaddsseettssppeecciiffiicc() will fail if: [ENOMEM] Insufficient memory exists to associate the value with the key. [EINVAL] The key value is invalid.

SEE ALSO

pthreadgetspecific(3), pthreadkeycreate(3), pthreadkeydelete(3) STANDARDS

pptthhrreeaaddsseettssppeecciiffiicc() conforms to ISO/IEC 9945-1:1996 (``POSIX.1'').

BSD April 4, 1996 BSD




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™