1.0.6.36: ALLOW-WITH-INTERRUPTS and interrupt safe WITH-MUTEX &co
* Remove the *IN-INTERRUPTION* kludge, and replace it with a
general-purpose mechanism.
* New variable: *ALLOW-WITH-INTERRRUPTS*. WITH-INTERRUPTS is a no-op
unless it is true and interrupts are inhibited.
* WITHOUT-INTERRUPTS binds *ALLOW-WITH-INTERRUPTS* to NIL, and
establishes ALLOW-WITH-INTERRUPTS and WITH-LOCAL-INTERRUPTS as
local macros.
ALLOW-WITH-INTERRUPTS binds *ALLOW-WITH-INTERRUPTS* to the value it
held before entry to WITHOUT-INTERRUPTS.
WITH-LOCAL-INTERRUPTS is equivalent to
(allow-with-interrups (with-interrupts ...))
but somewhat more efficient.
* Use the above to make WITH-MUTEX &co interrupt-safe, but still
interruptible: WITH-FOO becomes
(without-interrupts
(unwind-protect
(when (setf foo (allow-with-interrupts (get-foo)))
(with-local-interrupts ...))
(when foo
(release-foo foo))))
and GET-FOO wraps it's waiting section inside a WITH-INTERRUPTS.
* While at it, rewrite WITH-MUTEX &co to use CALL-WITH-FOO style
expansions.
* Write CALL-WITH-SYSTEM-MUTEX as a more efficient alternative to:
(without-interrupt (with-mutex ...)) ; and
(without-gcing (with-mutex ...))
Similarly for CALL-WITH-RECURSIVE-SYSTEM-SPINLOCK, for the benefit
of PCL.
* No need to signal a WARNING for WITH-INTERRUPTS inside a WITHOUT-GCING,
as *ALLOW-WITH-INTERRUPTS* is always false there, so interrupts will
not be enabled.
22 files changed: