fix oops
This commit is contained in:
parent
9d36c826c0
commit
05a908c3c9
1 changed files with 3 additions and 4 deletions
|
@ -94,10 +94,9 @@ enteringStage :: WorkerStage -> Annex a -> Annex a
|
|||
enteringStage newstage a = do
|
||||
mytid <- liftIO myThreadId
|
||||
tv <- Annex.getState Annex.workers
|
||||
let setup = changeStageTo mytid tv newstage
|
||||
let cleanup Nothing = noop
|
||||
let cleanup (Just oldstage) = changeStageTo mytid tv oldstage
|
||||
bracket setup cleanup (const a)
|
||||
let set = changeStageTo mytid tv newstage
|
||||
let restore = maybe noop (void . changeStageTo mytid tv)
|
||||
bracket set restore (const a)
|
||||
|
||||
changeStageTo :: ThreadId -> TMVar (WorkerPool AnnexState) -> WorkerStage -> Annex (Maybe WorkerStage)
|
||||
changeStageTo mytid tv newstage = liftIO $ atomically $ do
|
||||
|
|
Loading…
Reference in a new issue