Name

mp:get-lock — Try to obtain a lock.

Function

(mp:get-lock lock &optional wait)

lock

An object of type mp:lock.

wait

Whether to wait to obtain the lock. Defaults to NIL.

Description

This function tries to obtain exclusive use of a lock. If wait is T, and another task owns the lock, it may wait until the lock has been released. If wait is NIL it will return true if and only if it succeeded on acquiring the lock.

Example

See mp:with-lock.