Reset start times of threads when restoring image.
authorChris Hanson <org/chris-hanson/cph>
Thu, 6 Sep 2018 01:26:12 +0000 (18:26 -0700)
committerChris Hanson <org/chris-hanson/cph>
Thu, 6 Sep 2018 01:26:12 +0000 (18:26 -0700)
src/runtime/thread.scm

index 19c163e24265c64faf540eb471f946d19bf7dbb2..3fb29d404e59691df765cbf89369b8b1b43b4925 100644 (file)
@@ -178,7 +178,12 @@ USA.
 (define (reset-threads-high!)
   (set! io-registry (and have-select? (make-select-registry)))
   (set! io-registrations #f)
-  (set! subprocess-registrations '()))
+  (set! subprocess-registrations '())
+  (map-over-population! thread-population
+    (let ((times (get-system-times)))
+      (lambda (thread)
+       (if (thread/start-times thread)
+           (set-thread/start-times! thread times))))))
 
 (define (make-thread continuation)
   (let ((thread (%make-thread (make-1d-table))))