summaryrefslogtreecommitdiff
path: root/compiler/utils/FastFunctions.hs
diff options
context:
space:
mode:
authorZejun Wu <watashi@fb.com>2018-11-22 11:49:51 -0500
committerBen Gamari <ben@smart-cactus.org>2018-11-22 13:14:01 -0500
commitf088c2d42aaa38b32482ea8c4324786123835e62 (patch)
treeb69025c1219faf92f2786943b2b7ff9256ead1d7 /compiler/utils/FastFunctions.hs
parent1f74f7dd9ffec3540b9bd74225665dfa1519c46e (diff)
downloadhaskell-f088c2d42aaa38b32482ea8c4324786123835e62.tar.gz
Fix deadlock bug when mkFastStringWith is duplicated
In D5211, we use `withMVar` to guard writes to the same segment, this is unsafe to be duplicated. It can lead to deadlock if it is only run partially and `putMVar` is not called after `takeMVar`. Test Plan: ./validate We used to see deadlock when building stackage without this fix, and it no longer happens. Reviewers: simonmar, bgamari Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5349
Diffstat (limited to 'compiler/utils/FastFunctions.hs')
-rw-r--r--compiler/utils/FastFunctions.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/utils/FastFunctions.hs b/compiler/utils/FastFunctions.hs
index be3f3cbee4..9a09bb7b76 100644
--- a/compiler/utils/FastFunctions.hs
+++ b/compiler/utils/FastFunctions.hs
@@ -15,7 +15,7 @@ import GhcPrelude ()
import GHC.Exts
import GHC.IO (IO(..))
--- Just like unsafePerformIO, but we inline it.
+-- Just like unsafeDupablePerformIO, but we inline it.
{-# INLINE inlinePerformIO #-}
inlinePerformIO :: IO a -> a
inlinePerformIO (IO m) = case m realWorld# of (# _, r #) -> r