gcnote: When heap runs low, abort just the current/console thread.
authorMatt Birkholz <matt@birchwood-abbey.net>
Fri, 16 Nov 2018 02:14:56 +0000 (19:14 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Fri, 16 Nov 2018 17:14:10 +0000 (10:14 -0700)
src/runtime/gcnote.scm
src/runtime/runtime.pkg

index de50abff1216ff7f2960c02bc66f8046efa4d1a9..d77fe6980509a7c5625fe3766b70785ce0fe8c8a 100644 (file)
@@ -120,14 +120,11 @@ USA.
     (without-interrupts
      (lambda ()
        (if (< (gc-statistic/heap-left statistic) 4096)
-          (begin
-            (for-each
-              (lambda (entry)
-                (signal-event (weak-car entry) abort-heap-low))
-              gc-events)
-            (let ((thread (console-thread)))
-              (if (and thread (not (weak-assq thread gc-events)))
-                  (signal-event thread abort-heap-low))))
+          (if first-running-thread
+              (signal-event first-running-thread abort-heap-low)
+              (let ((thread (console-thread)))
+                (if thread
+                    (signal-event thread abort-heap-low))))
           (for-each
             (lambda (entry)
               (let ((thread (weak-car entry))
index 8af0e7e7edf3d33ab215d71e483565ba87ab43ae..0a8d87041f8b277dc34497aa0d744752bc5b68e0 100644 (file)
@@ -2283,6 +2283,7 @@ USA.
   (export (runtime thread)
          %deregister-gc-event)
   (import (runtime thread)
+         first-running-thread
          %maybe-toggle-thread-timer
          %signal-thread-event)
   (initialization (initialize-package!)))