[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


tis_mutex_destroy

Destroys a mutex.

Syntax

tis_mutex_destroy(
                  mutex );
 


Argument Data Type Access

mutex opaque pthread_mutex_t write


C Binding

#include 

int tis_mutex_destroy ( pthread_mutex_t *mutex);

Arguments

mutex
Address of the mutex (passed by reference) to be destroyed.

Description

This routine destroys a mutex by uninitializing it, and should be called when a mutex object is no longer referenced. This routine may reclaim internal storage used by the mutex object.

It is safe to destroy an initialized mutex that is unlocked. However, it is illegal to destroy a locked mutex.

The results of this routine are unpredictable if the mutex object specified in the mutex argument does not currently exist, or is not initialized.

Return Values

If an error condition occurs, this routine returns an integer value indicating the type of error. Possible return values are as follows:
Return        Description

0 Successful completion. [EBUSY] An attempt is made to destroy the object referenced by mutex while it is locked or referenced. [EINVAL] The value specified by mutex is invalid. [EPERM] The caller does not have privileges to perform the operation.


Associated Routines

   tis_mutex_init
   tis_mutex_lock
   tis_mutex_trylock
   tis_mutex_unlock



[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]