pthread_key_delete()

delete thread-specific data key 

Function


SYNOPSIS

#include <pthread.h>

int pthread_key_delete(pthread_key_t key);


DESCRIPTION

The pthread_key_delete() function deletes a thread-specific data key previously returned by pthread_key_create(). The thread-specific data values associated with the key need not be NULL at the time pthread_key_delete() is called. It is the responsibility of the application to free any application storage or perform any cleanup actions for data structures related to the deleted key or associated thread-specific data in any threads; this cleanup can be done either before or after pthread_key_delete(). Any attempt to use the key following the call to pthread_key_delete() results in undefined behavior.

pthread_key_delete() can be called from within destructor functions. No destructor functions are invoked by pthread_key_delete(). Any destructor function that may have been associated with the key is no longer called on thread exit.


PARAMETERS

key 

Is the thread-specific data key to delete.


RETURN VALUES

On success, pthread_key_delete() returns 0. On error, one of the following values is returned:

EINVAL 

key is not a valid thread-specific data key.


CONFORMANCE

POSIX P1003.1 (1996)


MULTITHREAD SAFETY LEVEL

MT-safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
pthread_key_create()


PTC MKS Toolkit 10.4 Documentation Build 39.