prevent threads not awaiting migration from blocking their response
This commit is contained in:
parent
c49c1a89c9
commit
b8cedada48
|
@ -232,7 +232,9 @@ subscriptionDelivery serv senderID subList = do
|
|||
:: STM (Either String ()))
|
||||
-- TODO: should this always signal migration finished to avoid deadlocksP
|
||||
liftIO $ putMVar syncMVar () -- wakes up waiting thread
|
||||
liftIO $ putMVar syncMVar () -- blocks until waiting thread has resumed
|
||||
-- allow response to be completed independently from waiting thread
|
||||
_ <- liftIO . forkIO $ do
|
||||
putMVar syncMVar () -- blocks until waiting thread has resumed
|
||||
-- delete this migration from ongoing ones
|
||||
liftIO . atomically $ modifyTVar' (migrationsInProgress serv) $
|
||||
HMap.delete (fromInteger senderID)
|
||||
|
|
Loading…
Reference in a new issue