Mstdlib-1.24.0

Typedefs

typedef struct M_thread_cond M_thread_cond_t
 

Enumerations

enum  M_thread_condattr_t { M_THREAD_CONDATTR_NONE = 0 }
 

Functions

M_thread_cond_tM_thread_cond_create (M_uint32 attr)
 
void M_thread_cond_destroy (M_thread_cond_t *cond)
 
M_bool M_thread_cond_timedwait (M_thread_cond_t *cond, M_thread_mutex_t *mutex, M_uint64 millisec)
 
M_bool M_thread_cond_timedwait_abs (M_thread_cond_t *cond, M_thread_mutex_t *mutex, const M_timeval_t *abstime)
 
M_bool M_thread_cond_wait (M_thread_cond_t *cond, M_thread_mutex_t *mutex)
 
void M_thread_cond_broadcast (M_thread_cond_t *cond)
 
void M_thread_cond_signal (M_thread_cond_t *cond)
 

Detailed Description

Thread Conditionals

Typedef Documentation

◆ M_thread_cond_t

typedef struct M_thread_cond M_thread_cond_t

Enumeration Type Documentation

◆ M_thread_condattr_t

Conditional attributes. Used for conditional creation.

Enumerator
M_THREAD_CONDATTR_NONE 

None.

Function Documentation

◆ M_thread_cond_create()

M_thread_cond_t * M_thread_cond_create ( M_uint32  attr)

Conditional create.

Parameters
[in]attrM_thread_condattr_t attributes which control how the conditional should behave.
Returns
Conditional on success otherwise NULL on error.

◆ M_thread_cond_destroy()

void M_thread_cond_destroy ( M_thread_cond_t cond)

Destroy a conditional.

Parameters
[in]condThe conditional.

◆ M_thread_cond_timedwait()

M_bool M_thread_cond_timedwait ( M_thread_cond_t cond,
M_thread_mutex_t mutex,
M_uint64  millisec 
)

Wait on conditional with a timeout of now + millisec.

Parameters
[in]condThe conditional.
[in,out]mutexThe mutex to operate on.
[in]millisecThe amount of time wait from now in milliseconds.
Returns
M_TRUE if the conditional was activated. M_FALSE on timeout or other error.
See also
M_thread_cond_wait
M_thread_cond_timedwait_abs

◆ M_thread_cond_timedwait_abs()

M_bool M_thread_cond_timedwait_abs ( M_thread_cond_t cond,
M_thread_mutex_t mutex,
const M_timeval_t abstime 
)

Wait on conditional until a specified time.

Parameters
[in]condThe conditional.
[in,out]mutexThe mutex to operate on.
[in]abstimeTime to wait until.
Returns
M_TRUE if the conditional was activated. M_FALSE on timeout or other error.
See also
M_thread_cond_wait
M_thread_cond_timedwait

◆ M_thread_cond_wait()

M_bool M_thread_cond_wait ( M_thread_cond_t cond,
M_thread_mutex_t mutex 
)

Wait on conditional

Blocks the thread until the conditional is activated.

The mutex must be locked before calling this function. This will unlock the mutex and block on the conditional. When the conditional is activated the mutex will be locked.

Parameters
[in]condThe conditional.
[in,out]mutexThe mutex to operate on.
Returns
M_TRUE if the conditional was activated. M_FALSE on error.
See also
M_thread_cond_timedwait
M_thread_cond_timedwait_abs

◆ M_thread_cond_broadcast()

void M_thread_cond_broadcast ( M_thread_cond_t cond)

Activate all waiting conditionals.

Parameters
[in]condThe conditional.

◆ M_thread_cond_signal()

void M_thread_cond_signal ( M_thread_cond_t cond)

Activate a waiting conditional (single).

Parameters
[in]condThe conditional.