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

NextPrevUpTopContentsIndex

process-sharing-lock

Function
Summary

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

Package

mp

Signature

process-sharing-lock sharing-lock &optional whostate timeout

Arguments

sharing-lock

A sharing lock.

whostate

The status of the process while the lock is locked, as seen in the Process Browser.

timeout

A timeout period, in seconds.

Description

This is like process-lock, but the lock must be "sharing" and the lock will be locked in shared mode. That means that other threads can also lock it in shared mode.

Before locking this waits for the lock to be free of any exclusive lock, but it does not check for other shared mode use of the same lock.

Calls to process-sharing-lock should be matched by calls to process-sharing-unlock. Normally with-sharing-lock is the best way to achieve this.

Notes

It is possible to lock for sharing inside the scope of sharing lock and inside the scope of exclusive lock.

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

See also

process-lock
process-sharing-unlock
with-sharing-lock


LispWorks User Guide and Reference Manual - 21 Dec 2011

NextPrevUpTopContentsIndex