pthread_mutex_destroy Subroutine



Purpose

Deletes a mutex.

Library

Threads Library (libpthreads.a)

Syntax

#include 

int pthread_mutex_destroy (mutex)
pthread_mutex_t *mutex;

Description

The pthread_mutex_destroy subroutine deletes the mutex mutex. After
deletion of the mutex, the mutex parameter is not valid until it is
initialized again by a call to the pthread_mutex_init subroutine.

Note:	The pthread.h header file must be the first included file of
each source file using the threads library.

Parameter

mutex	Specifies the mutex to delete.

Return Values

Upon successful completion, 0 is returned. Otherwise, an error code
is returned.

Error Codes

The pthread_mutex_destroy subroutine is unsuccessful if the following
is true:

EBUSY	The mutex mutex is locked or referenced by another thread.

EINVAL	The mutex parameter is not valid.

Implementation Specifics

This subroutine is part of the Base Operating System (BOS) Runtime.

Related Information

The pthread_mutex_init subroutine.

Using Mutexes.

Threads Library Quick Reference.