aboutsummaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-05-11 18:29:51 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-05-11 18:29:51 -0400
commit7b4b95f9ac0e2a441881cc2108dc39c8888a4b18 (patch)
tree3542d3dace83467856a6fb7bb26d1358dba9ba62 /Annex.hs
parent8dad413ea98a6558a0ad48ef626d914595c30d22 (diff)
fix sshCleanup race using STM
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Annex.hs b/Annex.hs
index 3c47789b5..597a5dd1b 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -71,6 +71,7 @@ import Utility.Url
import "mtl" Control.Monad.Reader
import Control.Concurrent
import Control.Concurrent.Async
+import Control.Concurrent.STM
import qualified Data.Map as M
import qualified Data.Set as S
@@ -124,7 +125,7 @@ data AnnexState = AnnexState
, groupmap :: Maybe GroupMap
, ciphers :: M.Map StorableCipher Cipher
, lockcache :: LockCache
- , sshstalecleaned :: MVar ()
+ , sshstalecleaned :: TMVar Bool
, flags :: M.Map String Bool
, fields :: M.Map String String
, cleanup :: M.Map CleanupAction (Annex ())
@@ -147,7 +148,7 @@ newState :: GitConfig -> Git.Repo -> IO AnnexState
newState c r = do
emptyactiveremotes <- newMVar M.empty
o <- newMessageState
- sc <- newMVar ()
+ sc <- newTMVarIO False
return $ AnnexState
{ repo = r
, repoadjustment = return