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


cma_mutex_unlock

Unlocks a mutex.

Syntax

cma_mutex_unlock(
                  mutex);
 


Argument Data Type Access

mutex opaque cma_t_mutex read


C Binding

#include 

void cma_mutex_unlock ( cma_t_mutex *mutex);

Arguments

mutex
Handle of the mutex unlocked.

Description

This routine unlocks a mutex and its behavior varies based on the kind of mutex. When an owner unlocks a recursive mutex, the lock count is decremented. The mutex remains locked and owned until the count reaches zero. When the lock count reaches 0, or for any other type of mutex, the mutex becomes unlocked with no current owner. If one or more threads are waiting to lock the specified mutex, calling this routine causes one thread to unblock and try to acquire the mutex.

The results of calling this routine are unpredictable if the mutex specified in mutex is already unlocked. In that case, the exception cma_e_use_error is raised.

The results of calling this routine are also unpredictable if the mutex specified in mutex is currently owned by a thread other than the calling thread. In that case, the exception cma_e_in_ use is raised.

Exceptions

cma_e_existence
cma_e_in_use
cma_e_use_error



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