[Git][ghc/ghc][wip/ioref-swap-xchg] Apply 1 suggestion(s) to 1 file(s)

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Wed Mar 29 14:50:06 UTC 2023



Ben Gamari pushed to branch wip/ioref-swap-xchg at Glasgow Haskell Compiler / GHC


Commits:
271e8a29 by Sylvain Henry at 2023-03-29T14:50:03+00:00
Apply 1 suggestion(s) to 1 file(s)
- - - - -


1 changed file:

- libraries/base/GHC/IORef.hs


Changes:

=====================================
libraries/base/GHC/IORef.hs
=====================================
@@ -128,8 +128,7 @@ atomicModifyIORef'_ ref f = do
 -- the old contents.
 atomicSwapIORef :: IORef a -> a -> IO a
 atomicSwapIORef (IORef (STRef ref)) new = IO $ \s ->
-  case atomicSwapMutVar# ref new s of
-    (# s', old #) -> (# s', old #)
+atomicSwapIORef (IORef (STRef ref)) new = IO (atomicSwapMutVar# ref new)
 
 -- | A strict version of 'Data.IORef.atomicModifyIORef'.  This forces both the
 -- value stored in the 'IORef' and the value returned.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/271e8a2988add7df70c55c0b9dd37e1bb6f9781f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/271e8a2988add7df70c55c0b9dd37e1bb6f9781f
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230329/927182d2/attachment-0001.html>


More information about the ghc-commits mailing list