pthread_mutex_destroy(3) — Subroutines
NAME
pthread_mutex_destroy − Deletes a mutex.
SYNOPSIS
#include <pthread.h>
int pthread_mutex_destroy(
pthread_mutex_t ∗mutex );
PARAMETERS
mutexMutex to be deleted.
DESCRIPTION
This routine deletes a mutex and should be called when a mutex object will no longer be referenced. The effect of calling this routine is to reclaim storage for the mutex object.
It is illegal to delete a mutex that has a current owner (in other words, is locked).
The results of this routine are unpredictable if the mutex object specified in the mutex parameter does not currently exist.
RETURN VALUES
If an error condition occurs, this routine returns –1 and sets errno to the corresponding error value. Possible return values are as follows:
| Return | Error | Description |
| 0 | Successful completion. | |
| −1 | [EBUSY] | An attempt was made to destroy a mutex that is locked. |
| −1 | [EINVAL] | The value specified by mutex is invalid. |
RELATED INFORMATION
pthread_mutex_init(3), pthread_mutex_lock(3), pthread_mutex_trylock(3), pthread_mutex_unlock(3)