From 9900689cc1169b463863aa797af1c1d532956dff Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Tue, 10 Mar 2015 15:49:32 -0700 Subject: [PATCH] smp: Squash into b9a4a7b. Disk-save only if sole running thread. --- src/runtime/runtime.pkg | 2 ++ src/runtime/savres.scm | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index b752be9ae..f014bc266 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -3604,6 +3604,8 @@ USA. (define-package (runtime save/restore) (files "savres") (parent (runtime)) + (import (runtime thread) + enable-smp?) (export () disk-restore disk-save diff --git a/src/runtime/savres.scm b/src/runtime/savres.scm index eecfd60d5..9089ae254 100644 --- a/src/runtime/savres.scm +++ b/src/runtime/savres.scm @@ -50,13 +50,14 @@ USA. (let ((filename (->namestring (merge-pathnames filename))) (id (if (default-object? id) world-id id)) (time (local-decoded-time))) + (if (and enable-smp? (other-running-threads?)) + (error "Cannot disk-save with other running threads.")) (gc-clean) ((without-interrupts (lambda () (call-with-current-continuation (lambda (continuation) - (if (implemented-primitive-procedure? - (ucode-primitive smp-count 0)) + (if enable-smp? (smp-drop-band continuation filename id time) (drop-band continuation filename id time)) (read-microcode-tables!) -- 2.25.1