speed up enteringStage in non-concurrent mode

Avoid a STM transaction.

Also got rid of UnallocatedWorkerPool.
This commit is contained in:
Joey Hess 2019-06-19 15:47:54 -04:00
parent 05a908c3c9
commit 9671248fff
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 29 additions and 39 deletions

View file

@ -142,7 +142,7 @@ data AnnexState = AnnexState
, tempurls :: M.Map Key URLString
, existinghooks :: M.Map Git.Hook.Hook Bool
, desktopnotify :: DesktopNotify
, workers :: TMVar (WorkerPool AnnexState)
, workers :: Maybe (TMVar (WorkerPool AnnexState))
, activekeys :: TVar (M.Map Key ThreadId)
, activeremotes :: MVar (M.Map (Types.Remote.RemoteA Annex) Integer)
, keysdbhandle :: Maybe Keys.DbHandle
@ -155,7 +155,6 @@ newState :: GitConfig -> Git.Repo -> IO AnnexState
newState c r = do
emptyactiveremotes <- newMVar M.empty
emptyactivekeys <- newTVarIO M.empty
emptyworkerpool <- newTMVarIO UnallocatedWorkerPool
o <- newMessageState
sc <- newTMVarIO False
return $ AnnexState
@ -200,7 +199,7 @@ newState c r = do
, tempurls = M.empty
, existinghooks = M.empty
, desktopnotify = mempty
, workers = emptyworkerpool
, workers = Nothing
, activekeys = emptyactivekeys
, activeremotes = emptyactiveremotes
, keysdbhandle = Nothing