summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-05-18 16:23:07 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-05-19 14:09:52 -0400
commitae5433c4caf0ee57e3338df6dcd625f20ece7101 (patch)
tree5bdab44419df36e7e5aab2e36cd6b221654de04e /Remote
parent94a3e606fb31150c969d63790ec1ef870f413cc1 (diff)
use lock pools throughout git-annex
The one exception is in Utility.Daemon. As long as a process only daemonizes once, which seems reasonable, and as long as it avoids calling checkDaemon once it's already running as a daemon, the fcntl locking gotchas won't be a problem there. Annex.LockFile has it's own separate lock pool layer, which has been renamed to LockCache. This is a persistent cache of locks that persist until closed. This is not quite done; lockContent stil needs to be converted.
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Helper/Hooks.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Remote/Helper/Hooks.hs b/Remote/Helper/Hooks.hs
index 53bb370a6..1f46eaa4b 100644
--- a/Remote/Helper/Hooks.hs
+++ b/Remote/Helper/Hooks.hs
@@ -16,7 +16,7 @@ import Types.Remote
import Types.CleanupActions
import qualified Annex
import Annex.LockFile
-import Utility.LockFile
+import Utility.LockPool
#ifndef mingw32_HOST_OS
import Annex.Perms
#endif
@@ -47,7 +47,7 @@ runHooks :: Remote -> Maybe String -> Maybe String -> Annex a -> Annex a
runHooks r starthook stophook a = do
dir <- fromRepo gitAnnexRemotesDir
let lck = dir </> remoteid ++ ".lck"
- whenM (notElem lck . M.keys <$> getLockPool) $ do
+ whenM (notElem lck . M.keys <$> getLockCache) $ do
liftIO $ createDirectoryIfMissing True dir
firstrun lck
a
@@ -62,7 +62,7 @@ runHooks r starthook stophook a = do
-- of it from running the stophook. If another
-- instance is shutting down right now, this
-- will block waiting for its exclusive lock to clear.
- lockFileShared lck
+ lockFileCached lck
-- The starthook is run even if some other git-annex
-- is already running, and ran it before.