From 4b869cf336e7fbdb1151046a87603ab010f9ae5b Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sat, 24 Aug 2019 04:32:50 +0000 Subject: [PATCH] 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. --- src/runtime/floenv.scm | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) 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) -- 2.25.1