From 8e0f00a824e4d2ba103e5e7464946b63cf05f067 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 9 Jan 2019 04:04:51 +0000 Subject: [PATCH] Defer unmasking timer interrupt until after daemon is marked running. Otherwise we might re-enter on timer interrupt. --- src/runtime/interrupt.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runtime/interrupt.scm b/src/runtime/interrupt.scm index 2fcd665a1..b77ea436e 100644 --- a/src/runtime/interrupt.scm +++ b/src/runtime/interrupt.scm @@ -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) -- 2.25.1