From 468202cf45aa5d4f59179a0a0ac70fcbc4e7b24f Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Sat, 9 Mar 2019 15:43:30 +0000 Subject: [PATCH] Fix instance mutex deadlock, accidentally initialized the MVar empty --- src/Vervis/RemoteActorStore.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Vervis/RemoteActorStore.hs b/src/Vervis/RemoteActorStore.hs index 4226a31..86f1c7d 100644 --- a/src/Vervis/RemoteActorStore.hs +++ b/src/Vervis/RemoteActorStore.hs @@ -28,7 +28,7 @@ where import Prelude -import Control.Concurrent.MVar (MVar, newEmptyMVar) +import Control.Concurrent.MVar (MVar, newMVar) import Control.Concurrent.STM.TVar import Control.Monad import Control.Monad.STM @@ -93,7 +93,7 @@ withHostLock host action = do case existing of Just v -> return v Nothing -> do - v <- newEmptyMVar + v <- newMVar () atomically $ stateTVar tvar $ \ m -> case M.lookup host m of Just v' -> (v', m)