All Manuals > LispWorks User Guide and Reference Manual > 44 The MP Package

NextPrevUpTopContentsIndex

condition-variable-wait

Function
Summary

Waits for a given condition variable to be signaled.

Package

mp

Signature

condition-variable-wait condvar lock &key timeout wait-reason => wakep

Arguments

condvar

A condition variable

lock

A mp:lock

timeout

nil or a positive real

wait-reason

A string

Values

wakep

A generalized boolean

Description

The function condition-variable-wait waits at most timeout seconds for the condition variable condvar to be signaled. The lock lock is released while waiting and claimed again before returning. The caller must be holding the lock lock before calling this function.

The return value wakep is non-nil if the signal was received or nil if there was a timeout. If timeout is nil, condition-variable-wait waits indefinitely.

If wait-reason is non-nil, it is used as the wait-reason while waiting for the signal.

It is recommended that you use lock-and-condition-variable-wait or simple-lock-and-condition-variable-wait instead of condition-variable-wait. The locking functions make it easier to avoid mistakes, and can be more efficient.

Notes

timeout controls how long to wait for the signal: before returning, the function waits to claim the lock, possibly indefinitely.

See also

condition-variable-wait-count
make-condition-variable
lock-and-condition-variable-wait
simple-lock-and-condition-variable-wait
lock-and-condition-variable-signal
lock-and-condition-variable-broadcast
condition-variable-signal
condition-variable-broadcast


LispWorks User Guide and Reference Manual - 13 Feb 2015

NextPrevUpTopContentsIndex