summaryrefslogtreecommitdiff
path: root/libraries/base/Control/Concurrent
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2015-09-18 17:54:22 +0200
committerBen Gamari <ben@smart-cactus.org>2015-09-23 11:56:17 +0200
commitc6bdf4fb0b06ac55a7bb200f0ef31ea9a7a830ec (patch)
tree7077de0aa1bf4769d878c9fc26331a59b62cd706 /libraries/base/Control/Concurrent
parent79f57325dca4d1ce4601d01c4fab50f7bcfc9b9b (diff)
downloadhaskell-c6bdf4fb0b06ac55a7bb200f0ef31ea9a7a830ec.tar.gz
Remove references to () from types of mkWeak# and friends
Previously the types needlessly used (), which is defined ghc-prim, leading to unfortunate import cycles. See #10867 for details. Updates stm submodule.
Diffstat (limited to 'libraries/base/Control/Concurrent')
-rw-r--r--libraries/base/Control/Concurrent/MVar.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/libraries/base/Control/Concurrent/MVar.hs b/libraries/base/Control/Concurrent/MVar.hs
index 45c05fdc9b..5ffac11077 100644
--- a/libraries/base/Control/Concurrent/MVar.hs
+++ b/libraries/base/Control/Concurrent/MVar.hs
@@ -270,5 +270,8 @@ addMVarFinalizer = GHC.MVar.addMVarFinalizer
--
-- @since 4.6.0.0
mkWeakMVar :: MVar a -> IO () -> IO (Weak (MVar a))
-mkWeakMVar m@(MVar m#) f = IO $ \s ->
- case mkWeak# m# m f s of (# s1, w #) -> (# s1, Weak w #)
+mkWeakMVar m@(MVar m#) (IO f) = IO $ \s ->
+ case mkWeak# m# m finalizer s of (# s1, w #) -> (# s1, Weak w #)
+ where
+ finalizer :: State# RealWorld -> State# RealWorld
+ finalizer s' = case f s' of (# s'', () #) -> s''