diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-05-18 16:23:07 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-05-19 14:09:52 -0400 |
commit | ae5433c4caf0ee57e3338df6dcd625f20ece7101 (patch) | |
tree | 5bdab44419df36e7e5aab2e36cd6b221654de04e /Annex/Ssh.hs | |
parent | 94a3e606fb31150c969d63790ec1ef870f413cc1 (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 'Annex/Ssh.hs')
-rw-r--r-- | Annex/Ssh.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs index cd28d1fc0..627c04532 100644 --- a/Annex/Ssh.hs +++ b/Annex/Ssh.hs @@ -37,7 +37,7 @@ import Types.CleanupActions import Annex.Index (addGitEnv) #ifndef mingw32_HOST_OS import Annex.Perms -import Utility.LockFile +import Utility.LockPool #endif {- Generates parameters to ssh to a given host (or user@host) on a given @@ -126,13 +126,13 @@ prepSocket socketfile = do -- If the lock pool is empty, this is the first ssh of this -- run. There could be stale ssh connections hanging around -- from a previous git-annex run that was interrupted. - whenM (not . any isLock . M.keys <$> getLockPool) + whenM (not . any isLock . M.keys <$> getLockCache) sshCleanup -- Cleanup at end of this run. Annex.addCleanup SshCachingCleanup sshCleanup liftIO $ createDirectoryIfMissing True $ parentDir socketfile - lockFileShared $ socket2lock socketfile + lockFileCached $ socket2lock socketfile enumSocketFiles :: Annex [FilePath] enumSocketFiles = go =<< sshCacheDir |