Fix deadlock bug when mkFastStringWith is duplicated

Authored by watashi on Nov 22 2018, 10:49 AM.

Description

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

Details

Committed
bgamariNov 22 2018, 12:14 PM
Reviewer
simonmar
Differential Revision
D5349: Fix deadlock bug when mkFastStringWith is duplicated
Parents
rGHC1f74f7dd9ffe: plugins10 no longer broken
Branches
Unknown
Tags
Unknown