libmetal
Loading...
Searching...
No Matches
Functions
Condition Variable Interfaces

Functions

static void metal_condition_init (struct metal_condition *cv)
 Initialize a libmetal condition variable.
 
static int metal_condition_signal (struct metal_condition *cv)
 Notify one waiter. Before calling this function, the caller should have acquired the mutex.
 
static int metal_condition_broadcast (struct metal_condition *cv)
 Notify all waiters. Before calling this function, the caller should have acquired the mutex.
 
int metal_condition_wait (struct metal_condition *cv, metal_mutex_t *m)
 Block until the condition variable is notified. Before calling this function, the caller should have acquired the mutex.
 

Detailed Description

Function Documentation

◆ metal_condition_broadcast()

static int metal_condition_broadcast ( struct metal_condition * cv)
inlinestatic

Notify all waiters. Before calling this function, the caller should have acquired the mutex.

Parameters
[in]cvcondition variable
Returns
zero on no errors, non-zero on errors
See also
metal_condition_wait, metal_condition_signal

◆ metal_condition_init()

static void metal_condition_init ( struct metal_condition * cv)
inlinestatic

Initialize a libmetal condition variable.

Parameters
[in]cvcondition variable to initialize.

◆ metal_condition_signal()

static int metal_condition_signal ( struct metal_condition * cv)
inlinestatic

Notify one waiter. Before calling this function, the caller should have acquired the mutex.

Parameters
[in]cvcondition variable
Returns
zero on no errors, non-zero on errors
See also
metal_condition_wait, metal_condition_broadcast

◆ metal_condition_wait()

int metal_condition_wait ( struct metal_condition * cv,
metal_mutex_t * m )

Block until the condition variable is notified. Before calling this function, the caller should have acquired the mutex.

Parameters
[in]cvcondition variable
[in]mmutex
Returns
0 on success, non-zero on failure.
See also
metal_condition_signal