thr_keydelete(3thread)


thr_keydelete -- thread-specific data key

Synopsis

   cc [options] -Kthread file
   

#include <thread.h>

int thr_keydelete(thread_key_t key)

Description

thr_keydelete deletes the specified key, which was obtained from a previous call to thr_keycreate.

Parameters


key
the key to be deleted

key parameter

key is the key to be deleted. key must no longer be in use, that is, no thread can have a non-NULL value bound to key, otherwise thr_keydelete will return EBUSY.

Usage

A typical use would be for a dynamically linked library to create its private key with thr_keycreate as part of its initialization, use thr_getspecific and thr_setspecific while in use, and then call thr_keydelete before unlinking.

The application should ensure that other thread-specific data functions for key are not called concurrently with thr_keydelete.

Return values

thr_keydelete returns zero for success and an error number for failure, as described below.

Errors

If any of the following conditions occur, thr_keydelete returns the corresponding value:

EBUSY
key has thread-specific data associated with it.

EINVAL
key is invalid.

References

Intro(3thread), thr_getspecific(3thread), thr_keycreate(3thread), thr_setspecific(3thread)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004