smp: Squash into b9a4a7b. Disk-save only if sole running thread.
authorMatt Birkholz <puck@birchwood-abbey.net>
Tue, 10 Mar 2015 22:49:32 +0000 (15:49 -0700)
committerMatt Birkholz <puck@birchwood-abbey.net>
Tue, 10 Mar 2015 22:49:32 +0000 (15:49 -0700)
src/runtime/runtime.pkg
src/runtime/savres.scm

index b752be9ae2ec2a5612f9e8e58a45fd616ff0b3eb..f014bc266ccf4d60d67131aa6b522aa2c9cd0b37 100644 (file)
@@ -3604,6 +3604,8 @@ USA.
 (define-package (runtime save/restore)
   (files "savres")
   (parent (runtime))
+  (import (runtime thread)
+         enable-smp?)
   (export ()
          disk-restore
          disk-save
index eecfd60d5ce25e38c798f3b40e98d840a6afe3a8..9089ae2541585644e78058eb8c613f935bb5fb10 100644 (file)
@@ -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!)