Skip to content
Snippets Groups Projects
Commit 59daab12 authored by wlott's avatar wlott
Browse files

Wrote the gengc version of without-interrupts.

parent 71c74aa3
Branches
Tags
No related merge requests found
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/signal.lisp,v 1.17 1992/07/09 19:27:05 wlott Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/signal.lisp,v 1.18 1993/05/20 13:58:02 wlott Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/signal.lisp,v 1.17 1992/07/09 19:27:05 wlott Exp $ ;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/signal.lisp,v 1.18 1993/05/20 13:58:02 wlott Exp $
;;; ;;;
;;; Code for handling UNIX signals. ;;; Code for handling UNIX signals.
;;; ;;;
...@@ -294,9 +294,6 @@ ...@@ -294,9 +294,6 @@
;;; with the cost of delivering the signal in the first place. ;;; with the cost of delivering the signal in the first place.
;;; ;;;
(defvar *interrupts-enabled* t)
(defvar *interrupt-pending* nil)
;;; DO-PENDING-INTERRUPT -- internal ;;; DO-PENDING-INTERRUPT -- internal
;;; ;;;
;;; Magically converted by the compiler into a break instruction. ;;; Magically converted by the compiler into a break instruction.
...@@ -304,6 +301,11 @@ ...@@ -304,6 +301,11 @@
(defun do-pending-interrupt () (defun do-pending-interrupt ()
(do-pending-interrupt)) (do-pending-interrupt))
#-gengc (progn
(defvar *interrupts-enabled* t)
(defvar *interrupt-pending* nil)
;;; WITHOUT-INTERRUPTS -- puiblic ;;; WITHOUT-INTERRUPTS -- puiblic
;;; ;;;
(defmacro without-interrupts (&body body) (defmacro without-interrupts (&body body)
...@@ -332,6 +334,30 @@ ...@@ -332,6 +334,30 @@
(do-pending-interrupt)) (do-pending-interrupt))
(,name)))))) (,name))))))
); #-gengc progn
;;; On the GENGC system, we have to do it slightly differently because of the
;;; existance 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 (kernel:mutator-suspends-disabled-count)))
,@body)
(locally
(declare (optimize (speed 3) (safety 0)))
(when (and (zerop (decf (kernel:mutator-suspends-disabled-count)))
(not (zerop (kernel:mutator-suspend-pending))))
(do-pending-interrupt)))))
;;;; WITH-ENABLED-INTERRUPTS ;;;; WITH-ENABLED-INTERRUPTS
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment