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

NextPrevUpTopContentsIndex

with-sharing-lock

Macro
Summary

Holds a lock in shared mode while executing a body of code.

Package

mp

Signature

with-sharing-lock (sharing-lock &optional whostate timeout) &body body => results

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.

body

The forms to execute

Values

results

The values returned from evaluating body.

Description

The macro with-sharing-lock is like with-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.

Notes

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

See also

make-lock
with-lock


LispWorks User Guide and Reference Manual - 13 Feb 2015

NextPrevUpTopContentsIndex