NextPrevUpTopContentsIndex

lock-owner

Function
Summary

Returns the owner of a lock.

Package

mp

Signature

lock-owner lock => result

Arguments

lock

A lock object

Values

result

A process, t or :unknown

Description

The lock-owner function returns the process that currently owns the lock, or nil .

If lock is locked then result is normally the process that locked it. If lock was locked while multiprocessing was not running then result is t . Also, if lock was locked by an unknown process (for example, the process is killed whilst holding the lock) then result is :unknown .

result is nil if lock is not locked.

Example
CL-USER 1 > (let ((lock (mp:make-lock :name
                                      "my lock")))
              (mp:lock-owner lock))
NIL
 
CL-USER 2 > (let ((lock (mp:make-lock :name
                                      "my lock")))
              (mp:with-lock (lock)
                (mp:lock-owner lock)))
#<MP:PROCESS Name "CAPI Execution Listener 1" Priority 0 State "Running">
See also

make-lock
with-lock
process-lock
process-unlock
lock-name


LispWorks Reference Manual - 12 Mar 2008

NextPrevUpTopContentsIndex