X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Fsignal.lisp;h=cc2100728e4d1958aa48bfd253604c2a67591b30;hb=d8978f48b6c8b583612f6adbe33d3030f862ef87;hp=41be48f55c57f6f100fe5da1cbfe4fa041b49bb2;hpb=06c341ebab3da2e81effcaacc2235f2b1e8bfa82;p=sbcl.git diff --git a/src/code/signal.lisp b/src/code/signal.lisp index 41be48f..cc21007 100644 --- a/src/code/signal.lisp +++ b/src/code/signal.lisp @@ -40,6 +40,14 @@ (defvar *interrupts-enabled* t) (defvar *interrupt-pending* nil) +;;; KLUDGE: This tells INTERRUPT-THREAD that it is being invoked as an +;;; interruption, so that if the thread being interrupted is the +;;; current thread it knows to enable interrupts. INVOKE-INTERRUPTION +;;; binds it to T, and WITHOUT-INTERRUPTS binds it to NIL, so that if +;;; interrupts are disable between INTERRUPT-THREAD and this we don't +;;; accidentally re-enable them. +(defvar *in-interruption* nil) + (sb!xc:defmacro without-interrupts (&body body) #!+sb-doc "Execute BODY with all deferrable interrupts deferred. Deferrable interrupts @@ -51,7 +59,8 @@ other threads." `(flet ((,name () ,@body)) (if *interrupts-enabled* (unwind-protect - (let ((*interrupts-enabled* nil)) + (let ((*interrupts-enabled* nil) + (*in-interruption* nil)) (,name)) ;; If we were interrupted in the protected section, then ;; the interrupts are still blocked and it remains so