Maestro Audio Framework  v 1.0
NXP Semiconductors
osa_cond.h File Reference

Contains condition variable (CV) function prototypes. More...

Functions

int osa_cond_create (OsaCondition *cond)
 Create CV object. More...
 
int osa_cond_destroy (OsaCondition *cond)
 Destroy CV object. More...
 
int osa_cond_wait (OsaCondition *cond, OsaMutex *mutex, uint32_t msec_timeout)
 Wait on a condition. More...
 
int osa_cond_signal (OsaCondition *cond)
 Signal a condition. More...
 
int osa_cond_broadcast (OsaCondition *cond)
 Broadcast a condition. More...
 

Function Documentation

◆ osa_cond_create()

int osa_cond_create ( OsaCondition cond)

Create and return a new condition variable object

Parameters
condA condition object that will be allocated and initialized. It is returned to the call on success.
Return values
ERRCODE_NO_ERRORFunction succeeded
ERRCODE_OUT_OF_MEMORYOut of memory
ERRCODE_BUSYAttempting to reinitialize an existing CV
ERRCODE_GENERAL_ERRORUnexpected system error

◆ osa_cond_destroy()

int osa_cond_destroy ( OsaCondition cond)

Free the resources for a condition variable object

Parameters
condA valid condition object
Return values
ERRCODE_NO_ERRORFunction succeeded
ERRCODE_BUSYAttempting to reinitialize an existing CV
ERRCODE_GENERAL_ERRORUnexpected system error

◆ osa_cond_wait()

int osa_cond_wait ( OsaCondition cond,
OsaMutex *  mutex,
uint32_t  msec_timeout 
)

Release the mutex and wait on the condition argument. The mutex is reacquired before the function returns.

Parameters
condA valid condition object
mutexA valid mutex object that the caller holds a lock on
msec_timeoutOptional timeout. If zero, the wait will block forever. Any other value will cause the wait to abort after the specified number of milliseconds.
Return values
ERRCODE_NO_ERRORFunction succeeded
ERRCODE_OUT_OF_MEMORYOut of memory
ERRCODE_INVALID_ARGUMENTInvalid condition parameter
ERRCODE_PERMISSION_DENIEDMutex not owned by the calling thread
ERRCODE_GENERAL_ERRORUnexpected system error

◆ osa_cond_signal()

int osa_cond_signal ( OsaCondition cond)

Unblock one thread waiting for the condition argument

Parameters
condA valid condition object
Return values
ERRCODE_NO_ERRORFunction succeeded
ERRCODE_OUT_OF_MEMORYOut of memory
ERRCODE_INVALID_ARGUMENTInvalid condition parameter
ERRCODE_GENERAL_ERRORUnexpected system error

◆ osa_cond_broadcast()

int osa_cond_broadcast ( OsaCondition cond)

Unblock all threads waiting for the condition argument

Parameters
condA valid condition object
Warning
On MQX this does the same as osa_cond_signal
Return values
ERRCODE_NO_ERRORFunction succeeded
ERRCODE_OUT_OF_MEMORYOut of memory
ERRCODE_INVALID_ARGUMENTInvalid condition parameter
ERRCODE_GENERAL_ERRORUnexpected system error