Destroys the specified key.
#include <pthread.h>
int pthread_key_delete (
pthread_key_t key);
(IN) Specifies the key to destroy.
If successful, returns 0; otherwise, returns a nonzero error code:
The pthread_key_delete functions frees up a previously allocated key, which results in revoking the slot number that was reserved in the CSD array. Once a key is destroyed, threads cannot manipulate the value that was associated with the key.
WARNING:When a key is deleted, any associated destructor is not called. You must clean up any values that threads might have associated with the key before that key is deleted.
Usually, you do not need to destroy a key. When a thread exits, the destructor is automatically called to destroy key values associated with that thread. When the last thread of your application exits, the destructor is called for the last time and the key is automatically destroyed.