git.iko.soy/distributed-process
on master help sign in
fixup! Kill processes on a local node upon `closeLocalNode`.
commitd57e702634f186690b77011d19facb9feb3f5cf9 authorMathieu Boespflug <m@tweag.io> dateSun 8 Mar 2015, 10:39 (12 years ago) parent2069756
1 file changed+1−1
src/Control/Distributed/Process/Node.hs+1−1
src/Control/Distributed/Process/Node.hs+1−1
@@ -323,6 +323,7 @@ startServiceProcesses node = do
323323-- | Force-close a local node, killing all processes on that node.
324324closeLocalNode :: LocalNode -> IO ()
325325closeLocalNode node = do
326+ modifyMVar_ (localState node) $ const $ return LocalNodeClosed
326327 withValidLocalState (localState node) $ \vst ->
327328 forM_ (vst ^. localProcesses) $ \lproc ->
328329 -- Semantics of 'throwTo' guarantee that target thread will get delivered
@@ -330,7 +331,6 @@ closeLocalNode node = do
330331 -- that's as good as we can do. No need to wait for thread to actually
331332 -- finish dying.
332333 killThread (processThread lproc)
333− modifyMVar_ (localState node) $ const $ return LocalNodeClosed
334334 NT.closeEndPoint (localEndPoint node)
335335
336336-- | Run a process on a local node and wait for it to finish