From ac15a3f764adef44a3e3d49881cf60619ce27042 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Thu, 9 Jul 2015 19:32:28 -0700 Subject: [PATCH] runtime/global: Use without-preemption in with-obarray-lock. --- src/runtime/thread.scm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/runtime/thread.scm b/src/runtime/thread.scm index fb5ed81fb..e947ae8b6 100644 --- a/src/runtime/thread.scm +++ b/src/runtime/thread.scm @@ -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) -- 2.25.1