Package: bordeaux-threads

Function acquire-lock

Lambda List

acquire-lock (lock &optional wait-p)

Details

Acquire the lock lock for the calling thread. wait-p governs what happens if the lock is not available: if wait-p is true, the calling thread will wait until the lock is available and then acquire it; if wait-p is nil, acquire-lock will return immediately. acquire-lock returns true if the lock was acquired and nil otherwise.

This specification does not define what happens if a thread attempts to acquire a lock that it already holds. For applications that require locks to be safe when acquired recursively, see instead make-recursive-lock and friends.