fix a deadlock when not using --auto
Live update never gets started, but then it still waited for it to finish. This only deadlocked with -J4 or so, not without -J. Unsure why.
This commit is contained in:
parent
b01a63ef62
commit
09955deebe
1 changed files with 6 additions and 5 deletions
|
@ -109,7 +109,8 @@ checkLiveUpdate lu a = Db.lockDbWhile (const go) go
|
||||||
|
|
||||||
finishedLiveUpdate :: LiveUpdate -> UUID -> Key -> SizeChange -> IO ()
|
finishedLiveUpdate :: LiveUpdate -> UUID -> Key -> SizeChange -> IO ()
|
||||||
finishedLiveUpdate NoLiveUpdate _ _ _ = noop
|
finishedLiveUpdate NoLiveUpdate _ _ _ = noop
|
||||||
finishedLiveUpdate lu u k sc = do
|
finishedLiveUpdate lu u k sc =
|
||||||
|
whenM (not <$> isEmptyMVar (liveUpdateReady lu)) $ do
|
||||||
finishv <- newEmptyMVar
|
finishv <- newEmptyMVar
|
||||||
tryNonAsync (putMVar (liveUpdateDone lu) (Just (u, k, sc, finishv))) >>= \case
|
tryNonAsync (putMVar (liveUpdateDone lu) (Just (u, k, sc, finishv))) >>= \case
|
||||||
Right () -> void $ tryNonAsync $ takeMVar finishv
|
Right () -> void $ tryNonAsync $ takeMVar finishv
|
||||||
|
|
Loading…
Reference in a new issue