PackageDb: Explicitly unlock package database before closing
[ghc.git] / libraries / ghc-boot / GHC / PackageDb.hs
index 9ce07e7..a59c46e 100644 (file)
@@ -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