summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2017-08-21 11:26:13 -0400
committerBen Gamari <ben@smart-cactus.org>2017-08-24 08:50:27 -0400
commit0ef79d5be44f87aecb2f85192e21af927374b5b8 (patch)
tree7d2c8be56553d33a8c4a6ec2b4ca48702747269f
parent61d541dd9cac2357b090c7b3ce7b4ce24b8f6e5b (diff)
downloadhaskell-wip/ghc-pkg-locking.tar.gz
PackageDb: Explicitly unlock package database before closingwip/ghc-pkg-locking
This is one possible cause of #13945.
-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 bf83d25baa..1dd0b1a787 100644
--- a/libraries/ghc-boot/GHC/PackageDb.hs
+++ b/libraries/ghc-boot/GHC/PackageDb.hs
@@ -261,7 +261,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