From: Taylor R Campbell Date: Sat, 24 Aug 2019 04:32:50 +0000 (+0000) Subject: Simplify flo:update-environment!. X-Git-Tag: mit-scheme-pucked-10.1.20~11^2~71 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=4b869cf336e7fbdb1151046a87603ab010f9ae5b;p=mit-scheme.git Simplify flo:update-environment!. Caller is interested in exceptions afterward, so it is not sensible to deregister interest in the floating-point environment afterward. If you really want that, surround it in flo:preserving-environment. --- diff --git a/src/runtime/floenv.scm b/src/runtime/floenv.scm index e24656d0c..db188d25f 100644 --- a/src/runtime/floenv.scm +++ b/src/runtime/floenv.scm @@ -134,19 +134,9 @@ USA. ((ucode-primitive set-float-environment 1) fp-env))) (define (flo:update-environment! fp-env) - ;; Prevent thread-switching between when we notify the thread - ;; scheduler that the environment has changed and when we actually - ;; trigger the update, which must happen when the machine is in the - ;; *old* environment. - ;; - ;; XXX We could just disable preemption, but we'd have to do that - ;; in DYNAMIC-WIND in case UPDATE-FLOAT-ENVIRONMENT signals an - ;; error, and DYNAMIC-WIND is super-expensive. - (without-interrupts - (lambda () - (set-thread-float-environment! (current-thread) (if fp-env #t #f)) - ((ucode-primitive update-float-environment 1) - (or fp-env default-environment))))) + (use-floating-point-environment!) + ((ucode-primitive update-float-environment 1) + (or fp-env default-environment))) (define default-environment)