*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> pthread_key_create (3p)              
Title
Content
Arch
Section
 

Contents


pthread_key_create(3P)					pthread_key_create(3P)


NAME    [Toc]    [Back]

     pthread_key_create	- thread-specific data key creation

C SYNOPSIS    [Toc]    [Back]

     #include <pthread.h>

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

DESCRIPTION    [Toc]    [Back]

     The pthread_key_create() function creates a key that can be used by all
     threads in	the process to get and set thread-specific data.  The newly
     created key is returned in	the memory pointed to by key.

     After a new key is	created, all active threads have the value NULL
     associated	with that key.	After a	new thread is created, the value NULL
     is	associated with	all keys for that thread.

     An	optional destructor function may be associated with each key.  Upon
     thread exit [see pthread_exit()], if a key	has a non-NULL destructor
     pointer and has a non-NULL	value associated with that key,	then the
     destructor	function will be called	with the associated value.  The	order
     of	destructor calls is unspecified.

     If, after the destructor functions	have been called for all non-NULL key
     values with associated destructor functions, there	are still some nonNULL
 key values with associated destructor	functions, then	the process
     will be repeated.	This loop will continue	until no non-NULL key values
     with associated destructor	functions exist.

DIAGNOSTICS    [Toc]    [Back]

     On	success, pthread_key_create() returns zero; otherwise, an error	number
     is	returned:

     [EAGAIN]	    The	limit on the total number of keys per process has been
		    exceeded [see NOTES].

SEE ALSO    [Toc]    [Back]

      
      
     pthread_setspecific(3P), pthread_getspecific(3P), pthread_key_delete(3P),
     pthread_exit(3P), sysconf(3C).

NOTES    [Toc]    [Back]

     The key limit can be obtained from	sysconf() using	the THREAD_KEYS_MAX
     option.


									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
pthread_setspecific Tru64 Sets the thread-specific data value associated with the specified key for the current thread
pthread_getspecific FreeBSD get a thread-specific data value
pthread_setspecific OpenBSD set a thread-specific data value
pthread_setspecific FreeBSD set a thread-specific data value
pthread_getspecific OpenBSD get a thread-specific data value
pthread_key_delete OpenBSD delete a thread-specific data key
pthread_setspecific IRIX thread-specific data management
pthread_getspecific Tru64 Obtains the thread-specific data associated with the specified key
pthread_key_delete IRIX thread-specific data key deletion
pthread_key_delete Tru64 Deletes a thread-specific data key
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service