mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-26 06:22:33 -08:00
run-program: simplify with-process-lock
We already have a race condition between mp:get-lock and mp:holding-lock-p, there is no point in trying to make sure the lock is released at all costs during an interrupt.
This commit is contained in:
parent
2dce0dabdb
commit
579a8d4380
1 changed files with 5 additions and 6 deletions
|
|
@ -12,12 +12,11 @@
|
|||
(ext:with-unique-names (lock wait-p)
|
||||
`(let ((,lock (external-process-%lock ,process))
|
||||
(,wait-p ,wait))
|
||||
(mp:without-interrupts
|
||||
(unwind-protect (mp::with-restored-interrupts
|
||||
(when (mp:get-lock ,lock ,wait-p)
|
||||
(locally ,@body)))
|
||||
(when (mp:holding-lock-p ,lock)
|
||||
(mp:giveup-lock ,lock))))))
|
||||
(when (mp:get-lock ,lock ,wait-p)
|
||||
(mp:without-interrupts
|
||||
(unwind-protect (mp::with-restored-interrupts
|
||||
(locally ,@body))
|
||||
(mp:giveup-lock ,lock))))))
|
||||
#-threads `(progn ,@body))
|
||||
|
||||
(defstruct (external-process (:constructor make-external-process ()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue