Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptcondwait.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptcondwait.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptcondwait.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptcondwait.html on line 8

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.

The implicit PtLeave() call that PtCondWait() makes before blocking turns the calling thread into an event non-reader. If you passed the Pt_DELAY_EXIT flag to PtEnter() before calling PtCondWait(), it also disables the effect of that flag. Before returning, PtCondWait() turns the thread back into an event reader if it was an event reader before, but will not turn the Pt_DELAY_EXIT flag back on. In particular, this means that if another thread has called PtExit(), this function does not return, even if a third thread signals the condvar.

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
cond is invalid.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

PtCondTimedWait(), PtEnter(), PtLeave()

pthread_cond_wait() in the QNX Neutrino Library Reference

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


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptcondwait.html on line 161

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptcondwait.html on line 161