Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

ado_mutex_lock()

Lock a mutex

Synopsis:

#include <audio_driver.h>

#define ado_mutex_lock( mutex )

Arguments:

mutex
The mutex to lock. The mutex is of type pthread_mutex_t *.

Description:

The ado_mutex_lock() macro locks the given mutex.

This macro is defined as pthread_mutex_lock(), or ado_mutex_lock_debug() if ADO_MUTEX_DEBUG and ADO_DEBUG are defined. The debug version uses ado_debug() to display a message so as to aid in locating a mutex problem in the driver.

For more information, see Debugging an audio driver in the Organization of a Driver chapter.

Returns:

Same as pthread_mutex_lock():

EOK
Success.
EAGAIN
Insufficient system resources available to lock the mutex.
EDEADLK
The calling thread already owns mutex, and the mutex doesn't allow recursive behavior.
EINVAL
The given mutex is invalid.

Classification:

QNX Neutrino

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread No

See also:

ado_mutex_destroy(), ado_mutex_init(), ado_mutex_unlock()

pthread_mutex_lock() in the QNX Library Reference