tizsync

group tizsync

Semaphore, mutex, and condition variable wrappers.

Typedefs

typedef void *tiz_mutex_t

Mutex opaque handle.

typedef void *tiz_sem_t

Semaphore opaque handle.

typedef void *tiz_cond_t

Conditional variable opaque handle.

typedef void *tiz_rwmutex_t

Read-write mutex opaque handle.

Functions

OMX_ERRORTYPE tiz_sem_init(tiz_sem_t *ap_sem, OMX_U32 a_value)

Initialize a semaphore object using the given value.

Return

OMX_ErrorNone if success, OMX_ErrorInsufficientResources or OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_sem_destroy(tiz_sem_t *ap_sem)

Free the resources associated with a semaphore object.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_sem_wait(tiz_sem_t *ap_sem)

Wait for a semaphore being posted.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_sem_timedwait(tiz_sem_t *ap_sem, OMX_U32 a_millis)

Wait for a semaphore being posted, for a limited amount of time.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_sem_post(tiz_sem_t *ap_sem)

Post semaphore.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_sem_getvalue(tiz_sem_t *ap_sem, OMX_S32 *ap_sval)

Get the current value of a semaphore object stored it in *ap_sval.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_mutex_init(tiz_mutex_t *ap_mutex)

Initialize a mutex.

Return

OMX_ErrorNone if success, OMX_ErrorInsufficientResources or OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_mutex_destroy(tiz_mutex_t *ap_mutex)

Destroy a mutex.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_mutex_lock(tiz_mutex_t *ap_mutex)

Lock a mutex.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_mutex_unlock(tiz_mutex_t *ap_mutex)

Unlock a mutex.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_rwmutex_init(tiz_rwmutex_t *ap_rwmutex)

Initialize a read-write mutex.

Return

OMX_ErrorNone if success, OMX_ErrorInsufficientResources or OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_rwmutex_destroy(tiz_rwmutex_t *ap_rwmutex)

Destroy a read-write mutex.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_rwmutex_rdlock(tiz_rwmutex_t *ap_rwmutex)

Lock a read-write mutex for reading.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_rwmutex_rwlock(tiz_rwmutex_t *ap_rwmutex)

Lock a read-write mutex for writing.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_rwmutex_unlock(tiz_rwmutex_t *ap_rwmutex)

Unlock a read-write mutex.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_cond_init(tiz_cond_t *ap_cond)

Initialize a condition variable.

Return

OMX_ErrorNone if success, OMX_ErrorInsufficientResources or OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_cond_destroy(tiz_cond_t *ap_cond)

Destroy a condition variable.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_cond_signal(tiz_cond_t *ap_cond)

Wake up one thread waiting for a condition variable.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_cond_wait(tiz_cond_t *ap_cond, tiz_mutex_t *ap_mutex)

Wait for a condition variable to be signaled or broadcast. ap_mutex is assumed to be locked before.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_cond_timedwait(tiz_cond_t *ap_cond, tiz_mutex_t *ap_mutex, OMX_U32 a_millis)

Wait for a condition variable to be signaled or broadcast until a_millis milliseconds. ap_mutex is assumed to be locked before.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.

OMX_ERRORTYPE tiz_cond_broadcast(tiz_cond_t *ap_cond)

Wake up all threads waiting for a condition variable.

Return

OMX_ErrorNone if success, OMX_ErrorUndefined otherwise.