int
pthread_cond_init(
pthread_cond_t * restrict cond
, const pthread_condattr_t * restrict attr
)
)
function creates a new condition variable, with attributes specified with
attr
.
If
attr
is NULL the default attributes are used.
Condition variables are intended to be used to communicate changes in the state of data shared between threads. Condition variables are always associated with a mutex to provide synchronized access to the shared data. A single predicate should always be associated with a condition variable. The predicate should identify a state of the shared data that must be true before the thread proceeds.
)
function will return zero and put the new condition variable id into
cond
,
otherwise an error number will be returned to indicate the error.
)
shall fail if:
EAGAIN
]
ENOMEM
]
pthread_cond_init()
may fail if:
EINVAL
]
attr
is invalid.
)
conforms to
ISO/IEC 9945-1:1996 (``POSIX.1'') .