@@ -1127,7 +1127,9 @@ postMessage pid msg = do
1127throwException :: Exception e => ProcessId -> e -> NC ()
1127throwException :: Exception e => ProcessId -> e -> NC ()
1128throwException pid e = do
1128throwException pid e = do
1129 node <- ask
1129 node <- ask
1130+ -- throwTo blocks until the exception is received by the target thread.
1131+ -- We fork a helper thread to avoid blocking the node controller.
1130− liftIO $ withLocalProc node pid $ \p -> throwTo (processThread p) e
1132+ liftIO $ withLocalProc node pid $ \p -> void $ forkIO $ throwTo (processThread p) e
1132withLocalProc :: LocalNode -> ProcessId -> (LocalProcess -> IO ()) -> IO ()
1134withLocalProc :: LocalNode -> ProcessId -> (LocalProcess -> IO ()) -> IO ()
1133withLocalProc node pid p =
1135withLocalProc node pid p =