Defer unmasking timer interrupt until after daemon is marked running.
authorTaylor R Campbell <campbell@mumble.net>
Wed, 9 Jan 2019 04:04:51 +0000 (04:04 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sat, 9 Feb 2019 17:00:15 +0000 (17:00 +0000)
Otherwise we might re-enter on timer interrupt.

src/runtime/interrupt.scm

index 2fcd665a1020810adeb8684cdf82b875c3e06afb..b77ea436e2aadb8e1dc24c1d21e3604c30ab60c0 100644 (file)
@@ -120,16 +120,17 @@ USA.
     (named-lambda (after-gc-interrupt-handler interrupt-code interrupt-enables)
       (declare (ignore interrupt-code interrupt-enables))
       (clear-interrupts! interrupt-bit/after-gc)
-      (set-interrupt-enables! interrupt-mask/timer-ok)
       ;; By checking that this handler is not still running we ignore
       ;; GCs that occur while we are running the daemons.  This helps
       ;; prevent us from getting into a loop just running the daemons.
       (if (not running?)
          (begin
            (set! running? #t)
+           (set-interrupt-enables! interrupt-mask/timer-ok)
            (trigger-gc-daemons!)
            (set! running? #f)
-           (handle-current-thread-events))))))
+           (handle-current-thread-events))
+         (set-interrupt-enables! interrupt-mask/timer-ok)))))
 
 (define event:console-resize)
 (define (console-resize-handler interrupt-code interrupt-enables)