X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fsignal.lisp;h=4205bf171438f047a592dfcd28d827288df27f67;hb=86210c4e406c1b2ff10cc3bac0e71435867db48b;hp=ab63538f04dc40b64bef99e4b1cd9ef45d1e9f9d;hpb=80722c917cade18ab933fd313b13c56c6073ae01;p=sbcl.git diff --git a/src/code/signal.lisp b/src/code/signal.lisp index ab63538..4205bf1 100644 --- a/src/code/signal.lisp +++ b/src/code/signal.lisp @@ -23,22 +23,20 @@ ;;; sets *interrupt-pending* and returns without handling the signal. ;;; ;;; When we drop out the without interrupts, we check to see whether -;;; *interrupt-pending* has been set. If so, we call -;;; do-pending-interrupt, which generates a SIGTRAP. The C code +;;; *INTERRUPT-PENDING* has been set. If so, we call +;;; RECEIVE-PENDING-INTERRUPT, which generates a SIGTRAP. The C code ;;; invokes the handler for the saved signal instead of the SIGTRAP ;;; after replacing the signal mask in the signal context with the ;;; saved value. When that hander returns, the original signal mask is ;;; installed, allowing any other pending signals to be handled. ;;; -;;; This means that the cost of without-interrupts is just a special +;;; This means that the cost of WITHOUT-INTERRUPTS is just a special ;;; binding in the case when no signals are delivered (the normal ;;; case). It's only when a signal is actually delivered that we use ;;; any system calls, and by then the cost of the extra system calls ;;; are lost in the noise when compared with the cost of delivering ;;; the signal in the first place. -#!-gengc (progn - (defvar *interrupts-enabled* t) (defvar *interrupt-pending* nil) @@ -57,7 +55,7 @@ ;; whether interrupts are pending before executing themselves ;; immediately? (when *interrupt-pending* - (do-pending-interrupt))) + (receive-pending-interrupt))) (,name))))) (sb!xc:defmacro with-interrupts (&body body) @@ -70,32 +68,8 @@ (,name) (let ((*interrupts-enabled* t)) (when *interrupt-pending* - (do-pending-interrupt)) + (receive-pending-interrupt)) (,name)))))) - -) ; PROGN - -;;; On the GENGC system, we have to do it slightly differently because of the -;;; existence of threads. Each thread has a suspends_disabled_count in its -;;; mutator structure. When this value is other then zero, the low level stuff -;;; will not suspend the thread, but will instead set the suspend_pending flag -;;; (also in the mutator). So when we finish the without-interrupts, we just -;;; check the suspend_pending flag and trigger a do-pending-interrupt if -;;; necessary. - -#!+gengc -(defmacro without-interrupts (&body body) - `(unwind-protect - (progn - (locally - (declare (optimize (speed 3) (safety 0))) - (incf (sb!kernel:mutator-interrupts-disabled-count))) - ,@body) - (locally - (declare (optimize (speed 3) (safety 0))) - (when (and (zerop (decf (sb!kernel:mutator-interrupts-disabled-count))) - (not (zerop (sb!kernel:mutator-interrupt-pending)))) - (do-pending-interrupt))))) ;;;; utilities for dealing with signal names and numbers @@ -103,9 +77,9 @@ (:constructor make-unix-signal (%name %number)) (:copier nil)) ;; signal keyword (e.g. :SIGINT for the Unix SIGINT signal) - (%name (required-argument) :type keyword :read-only t) + (%name (missing-arg) :type keyword :read-only t) ;; signal number - (%number (required-argument) :type integer :read-only t)) + (%number (missing-arg) :type integer :read-only t)) ;;; list of all defined UNIX-SIGNALs (defvar *unix-signals* nil)