Function ACQUIRE-LOCK, RELEASE-LOCK
Syntax:
acquire-lock lock &key (wait t) timeout => generalized-boolean
release-lock lock => lock
Arguments and values:
lock -> a lock object.
wait -> a generalized
boolean.
timeout -> a non-negative real number.
generalized-boolean -> a generalized
boolean.
Description:
Acquire lock
for the calling thread.
wait
governs what happens if the lock is not available: if wait
is
true, the calling thread will wait until the lock is available and
then acquire it; if wait
is nil, acquire-lock
will return
immediately. If wait
is true, timeout
may specify a maximum amount
of seconds to wait for the lock to become available.
acquire-lock
returns
true
if the lock was acquired, otherwise
false.
Exceptional situations:
Signals an error of type
type-error
if lock
is not a lock object.
Signals an error of type
type-error
if timeout
is neither nil nor a non-negative real number.
See also:
Notes:
It is implementation-defined what happens if a thread attempts to acquire a lock that it already holds.