Returns the owner of a lock.
The function lock-owner
returns the process that currently owns lock, or nil
.
If lock is a "sharing" lock then lock-owner
checks whether it is locked exclusively (see lock-owned-by-current-process-p).
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 while holding lock) then result is :unknown
.
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">
lock
lock-owned-by-current-process-p
make-lock
with-lock
process-lock
process-unlock
lock-name
lock-owned-by-current-process-p
Locks
LispWorks User Guide and Reference Manual - 20 Sep 2017