summaryrefslogtreecommitdiff
path: root/Annex/Journal.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/Journal.hs')
-rw-r--r--Annex/Journal.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/Annex/Journal.hs b/Annex/Journal.hs
index 8b88ab2fb..3f31cb941 100644
--- a/Annex/Journal.hs
+++ b/Annex/Journal.hs
@@ -20,6 +20,10 @@ import Annex.Exception
import qualified Git
import Annex.Perms
+#ifdef mingw32_HOST_OS
+import Utility.WinLock
+#endif
+
{- Records content for a file in the branch to the journal.
-
- Using the journal, rather than immediatly staging content to the index
@@ -116,13 +120,8 @@ lockJournal a = do
l <- noUmask mode $ createFile lockfile mode
waitToSetLock l (WriteLock, AbsoluteSeek, 0, 0)
return l
-#else
- lock lockfile _mode = do
- writeFile lockfile ""
- return lockfile
-#endif
-#ifndef mingw32_HOST_OS
unlock = closeFd
#else
- unlock = removeFile
+ lock lockfile _mode = waitToLock $ lockExclusive lockfile
+ unlock = dropLock
#endif