Locks a lock and calls a predicate. If this returns
nil, performs the equivalent of condition-variable-wait. Optionally calls a function on return.
A function designator.
A function designator or
It then applies predicate to args. If this call returns
nil it performs the equivalent of a call to condition-variable-wait, passing it condvar, lock, condvar-timeout and condvar-wait-reason.
Before returning, lock is unlocked (in an unwinding form) as in with-lock.
lock-and-condition-variable-wait returns whatever return-function returns if it is supplied. If return-function is not supplied,
lock-and-condition-variable-wait returns the result of predicate if this is not
nil, otherwise it returns the result of the equivalent call to condition-variable-wait.
lock-and-condition-variable-waitmakes it much easier to avoid mistakes when using condition-variables.
lock-and-condition-variable-waitdoes not lock on return, which makes it it much more efficient than the equivalent code using with-lock and condition-variable-wait.
LispWorks User Guide and Reference Manual - 20 Sep 2017