runtime/global: Use without-preemption in with-obarray-lock.
authorMatt Birkholz <puck@birchwood-abbey.net>
Fri, 10 Jul 2015 02:32:28 +0000 (19:32 -0700)
committerMatt Birkholz <puck@birchwood-abbey.net>
Fri, 10 Jul 2015 02:32:28 +0000 (19:32 -0700)
src/runtime/thread.scm

index fb5ed81fb4274e3862a0f277033fa9277ad2783c..e947ae8b64a2f2e101392ca1685394c1d862e53b 100644 (file)
@@ -76,15 +76,18 @@ USA.
   ;; Serialize with myriad parts of the microcode that hack the
   ;; obarray element of the fixed-objects vector.
   (if enable-smp?
-      (without-interrupts
+      (without-preemption
        (lambda ()
-        (if (eq? #t ((ucode-primitive smp-lock-obarray 1) #t))
-            (let ((value (thunk)))
-              (if (eq? #t ((ucode-primitive smp-lock-obarray 1) #f))
-                  value
-                  (%outf-error "with-obarray-lock: unlock failed")))
-            (%outf-error "with-obarray-lock: lock failed"))))
-      (without-interrupts thunk)))
+        (if (not (eq? #t ((ucode-primitive smp-lock-obarray 1) #t)))
+            (%outf-error "with-obarray-lock: lock failed"))
+        (let ((value (thunk)))
+          (if (not (eq? #t ((ucode-primitive smp-lock-obarray 1) #f)))
+              (%outf-error "with-obarray-lock: unlock failed"))
+          value)))
+      (let* ((mask (set-interrupt-enables! interrupt-mask/gc-ok))
+            (value (thunk)))
+       (set-interrupt-enables! mask)
+       value)))
 
 (define (without-preemption thunk)
   (let* ((thread first-running-thread)