diff options
author | Zubin Duggal <zubin@cmi.ac.in> | 2020-05-02 18:33:02 +0530 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-06 04:41:08 -0400 |
commit | 9f3e6884e338015f2953c4c0844e04d467f53dd5 (patch) | |
tree | fc4c72e7eb464dc357e2355a364343fad5044664 /testsuite | |
parent | b2d72c758233830446230800d0045badc01b42ca (diff) | |
download | haskell-9f3e6884e338015f2953c4c0844e04d467f53dd5.tar.gz |
Allow atomic update of NameCache in readHieFile
The situation arises in ghcide where multiple different threads may need to
update the name cache, therefore with the older interface it could happen
that you start reading a hie file with name cache A and produce name cache
A + B, but another thread in the meantime updated the namecache to A +
C. Therefore if you write the new namecache you will lose the A' updates
from the second thread.
Updates haddock submodule
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/hiefile/should_run/PatTypes.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/tests/hiefile/should_run/PatTypes.hs b/testsuite/tests/hiefile/should_run/PatTypes.hs index 25803d0e47..9f181c8577 100644 --- a/testsuite/tests/hiefile/should_run/PatTypes.hs +++ b/testsuite/tests/hiefile/should_run/PatTypes.hs @@ -57,7 +57,7 @@ main = do libdir:_ <- getArgs df <- dynFlagsForPrinting libdir nc <- makeNc - (hfr, nc') <- readHieFile nc "PatTypes.hie" + hfr <- readHieFile (NCU (\f -> pure $ snd $ f nc)) "PatTypes.hie" let hf = hie_file_result hfr forM_ [p1,p2,p3,p4] $ \point -> do putStr $ "At " ++ show point ++ ", got type: " |