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

process-exclusive-lock Function

Summary

Like process-lock, but on a "sharing" lock.

Package

mp

Signature

process-exclusive-lock sharing-lock &optional whostate timeout => result

Arguments
sharing-lock
A sharing lock.
whostate
A string or nil.
timeout
A non-negative real or nil.
Values
result
A boolean.
Description

The function process-exclusive-lock is the same as process-lock, but on a "sharing" lock. It waits until sharing-lock is free before locking it in exclusive mode.

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

timeout, if non-nil, specifies the time in seconds to wait before timing out. The default value of timeout is nil.

result is t if sharing-lock was successfully locked, and nil otherwise.

Calls to process-exclusive-lock should be paired with process-exclusive-unlock calls. In most cases the macro with-exclusive-lock the best way to achieve this.

Notes

It is not possible to use exclusive lock in the scope of a sharing lock on the same lock, and trying to do this will cause the process to hang. Whether it is possible to use an exclusive lock inside an exclusive lock of the same lock is determined by the recursivep argument in make-lock.

process-exclusive-lock is guaranteed to return if it locked sharing-lock, but may throw before locking, as described in 19.4.3 Guarantees and limitations when locking and unlocking.

See also

make-lock
process-lock
with-exclusive-lock
19.4 Locks


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:51