@@ -1166,16 +1166,17 @@ throwException :: Exception e => ProcessId -> e -> NC ()
1166throwException pid e = do
1166throwException pid e = do
1167 node <- ask
1167 node <- ask
1168 -- throwTo blocks until the exception is received by the target thread.
1168 -- throwTo blocks until the exception is received by the target thread.
1169− -- We fork a helper thread to avoid blocking the node controller.
1169+ -- We cannot easily make it happen asynchronpusly because then 'unlink'
1170+ -- semantics would break.
1170− liftIO $ withLocalProc node pid $ \p -> void $ forkIO $ throwTo (processThread p) e
1171+ liftIO $ withLocalProc node pid $ \p -> throwTo (processThread p) e
1172withLocalProc :: LocalNode -> ProcessId -> (LocalProcess -> IO ()) -> IO ()
1173withLocalProc :: LocalNode -> ProcessId -> (LocalProcess -> IO ()) -> IO ()
1173withLocalProc node pid p =
1174withLocalProc node pid p =
1174 -- By [Unified: table 6, rule missing_process] messages to dead processes
1175 -- By [Unified: table 6, rule missing_process] messages to dead processes
1175 -- can silently be dropped
1176 -- can silently be dropped
1176 let lpid = processLocalId pid in do
1177 let lpid = processLocalId pid in do
1177− withValidLocalState node $ \vst ->
1178+ join $ withValidLocalState node $ \vst ->
1178− forM_ (vst ^. localProcessWithId lpid) p
1179+ return $ forM_ (vst ^. localProcessWithId lpid) p
1180--------------------------------------------------------------------------------
1181--------------------------------------------------------------------------------
1181-- Accessors --
1182-- Accessors --