From 7b4b95f9ac0e2a441881cc2108dc39c8888a4b18 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 May 2017 18:29:51 -0400 Subject: fix sshCleanup race using STM --- Annex.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Annex.hs') 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 -- cgit v1.2.3