diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-05-11 18:29:51 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-05-11 18:29:51 -0400 |
commit | 7b4b95f9ac0e2a441881cc2108dc39c8888a4b18 (patch) | |
tree | 3542d3dace83467856a6fb7bb26d1358dba9ba62 /Annex.hs | |
parent | 8dad413ea98a6558a0ad48ef626d914595c30d22 (diff) |
fix sshCleanup race using STM
Diffstat (limited to 'Annex.hs')
-rw-r--r-- | Annex.hs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |