;; 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)