Operating systems, development tools, and professional services
for connected embedded systems
for connected embedded systems
![]() |
![]() |
![]() |
![]() |
PtCondTimedWait()
Block a thread on a conditional variable, with a time limit
Synopsis:
int PtCondTimedWait(
pthread_cond_t *cond,
const struct timespec *abstime );
Arguments:
- cond
- The condition variable to wait on.
- abstime
- A pointer to a timespec structure that specifies the absolute time by which the thread must unblock.
Library:
ph
Description:
PtCondTimedWait() is an equivalent of pthread_cond_timedwait() 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:
- another thread performs a signal or broadcast on the condition variable
(using
pthread_cond_signal()
or
pthread_cond_broadcast())
Or:
- the absolute time specified by abstime has passed
Or:
- a signal is delivered to the thread.
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, mutex or abstime was invalid.
Concurrent waits or timed waits on cond used different mutexes.
The current thread doesn't own mutex. - ETIMEDOUT
- The time specified by abstime has passed.
Classification:
Photon
| Safety: | |
|---|---|
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |
See also:
PtCondWait(), PtEnter(), PtLeave()
pthread_cond_timedwait() in the QNX Neutrino Library Reference
"Threads" in the Parallel Operations chapter of the Photon Programmer's Guide
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)