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
|
enteringStage newstage a = do
|
||||||
mytid <- liftIO myThreadId
|
mytid <- liftIO myThreadId
|
||||||
tv <- Annex.getState Annex.workers
|
tv <- Annex.getState Annex.workers
|
||||||
let setup = changeStageTo mytid tv newstage
|
let set = changeStageTo mytid tv newstage
|
||||||
let cleanup Nothing = noop
|
let restore = maybe noop (void . changeStageTo mytid tv)
|
||||||
let cleanup (Just oldstage) = changeStageTo mytid tv oldstage
|
bracket set restore (const a)
|
||||||
bracket setup cleanup (const a)
|
|
||||||
|
|
||||||
changeStageTo :: ThreadId -> TMVar (WorkerPool AnnexState) -> WorkerStage -> Annex (Maybe WorkerStage)
|
changeStageTo :: ThreadId -> TMVar (WorkerPool AnnexState) -> WorkerStage -> Annex (Maybe WorkerStage)
|
||||||
changeStageTo mytid tv newstage = liftIO $ atomically $ do
|
changeStageTo mytid tv newstage = liftIO $ atomically $ do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue