fix deadlock when state TMVar is empty
This commit is contained in:
parent
3cd8f1bb13
commit
fa6f404a5f
1 changed files with 3 additions and 1 deletions
|
@ -266,7 +266,9 @@ fromExternal lck external extractor a =
|
|||
go (Just st) = run st
|
||||
go Nothing = do
|
||||
st <- startExternal $ externalType external
|
||||
void $ liftIO $ atomically $ swapTMVar v st
|
||||
void $ liftIO $ atomically $ do
|
||||
void $ tryReadTMVar v
|
||||
putTMVar v st
|
||||
|
||||
{- Handle initial protocol startup; check the VERSION
|
||||
- the remote sends. -}
|
||||
|
|
Loading…
Add table
Reference in a new issue