[Previous] [Contents] [Index] [Next]

PtCondWait()

Block a thread on a conditional variable

Synopsis:

int PtCondWait( pthread_cond_t *cond );

Arguments:

cond
The condition variable to wait on.

Library:

ph

Description:

PtCondWait() is an equivalent of pthread_cond_wait() that uses the Photon library lock instead of a mutex, which has the effect of an implicit PtLeave() when you block, and PtEnter() when you unblock.

The calling thread is blocked until:

In all cases, the thread reacquires the Photon library lock before being unblocked.

Returns:

EOK
Success, or the call was interrupted by a signal.
EAGAIN
Insufficient system resources are available to wait on the condition.
EFAULT
A fault occurred trying to access the buffers provided.
EINVAL
One or more of cond or mutex is invalid.
Concurrent waits on cond used different mutexes.
The current thread doesn't own mutex.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

PtCondTimedWait(), PtEnter(), PtLeave()

pthread_cond_wait() in the QNX Library Reference

"Threads" in the Parallel Operations chapter of the Photon Programmer's Guide


[Previous] [Contents] [Index] [Next]