summaryrefslogtreecommitdiff
path: root/libraries/ghc-boot
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-08-29 14:45:28 -0400
committerBen Gamari <ben@smart-cactus.org>2017-08-29 19:08:07 -0400
commit779b9e6965416ee08af6eb15354cf09e9f40e0d9 (patch)
tree6c7fed169e206ffd58d46bfcfc2567b8903fc5da /libraries/ghc-boot
parenta27bb1bd6206bdd5e6004ec1f7e95144a0fcc4d4 (diff)
downloadhaskell-779b9e6965416ee08af6eb15354cf09e9f40e0d9.tar.gz
PackageDb: Explicitly unlock package database before closing
Reviewers: austin Subscribers: rwbarton, thomie GHC Trac Issues: #13945 Differential Revision: https://phabricator.haskell.org/D3874
Diffstat (limited to 'libraries/ghc-boot')
-rw-r--r--libraries/ghc-boot/GHC/PackageDb.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/libraries/ghc-boot/GHC/PackageDb.hs b/libraries/ghc-boot/GHC/PackageDb.hs
index 9ce07e7484..a59c46e585 100644
--- a/libraries/ghc-boot/GHC/PackageDb.hs
+++ b/libraries/ghc-boot/GHC/PackageDb.hs
@@ -267,7 +267,11 @@ lockPackageDbWith mode file = do
return $ PackageDbLock hnd
lockPackageDb = lockPackageDbWith ExclusiveLock
-unlockPackageDb (PackageDbLock hnd) = hClose hnd
+unlockPackageDb (PackageDbLock hnd) = do
+#if MIN_VERSION_base(4,11,0)
+ hUnlock hnd
+#endif
+ hClose hnd
-- MIN_VERSION_base(4,10,0)
#else