chsvlib
chsv helper source code

◆ chsv_cnd_init()

int Chusov::ExecutionControl::chsv_cnd_init ( chsv_cnd_t pCnd)
noexcept

Creates a condition variable and writes its descriptor to a specified location.

Parameters
[out]pCndis a pointer to a buffer where a descriptor of a created condition variable is written.
Returns
On success the function returns chsv_thrd_success. If the call fails because insufficient memory was available the function returns chsv_thrd_nomem setting errno to ENOMEM. On any other error the function returns chsv_thrd_error and sets a corresponding errno code.

The function implements a behaviour of the cnd_init function defined in the ISO/IEC 9899:2011 (aka C11) standard.

See also
chsv_cnd_destroy;
chsv_cnd_wait;
chsv_cnd_signal;
chsv_cnd_broadcast.