Andrea Vezzosi pushed to branch wip/romes/async-rpc at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • compiler/GHC/Runtime/Interpreter.hs
    ... ... @@ -653,7 +653,7 @@ stopInterp interp = case interpInstance interp of
    653 653
                 ex <- getProcessExitCode (interpHandle (instProcess i))
    
    654 654
                 if isJust ex
    
    655 655
                    then pure ()
    
    656
    -               else sendMessage i Shutdown `catch` \ PipeReadClosedException -> pure ()
    
    656
    +               else sendMessage i Shutdown
    
    657 657
                 -- We asked the server to shutdown, so we will also shutdown any communication.
    
    658 658
                 closePipe (interpPipe (instProcess i))
    
    659 659
                 pure InterpPending
    

  • libraries/ghci/GHCi/Server.hs
    ... ... @@ -209,6 +209,8 @@ defaultServerWithCustom customHandler = do
    209 209
       uninterruptibleMask $ \restore -> servWithCustom verbose hook pipe restore customHandler
    
    210 210
     
    
    211 211
       where hook = return -- empty hook
    
    212
    +    -- we cannot allow any async exceptions while communicating, because
    
    213
    +    -- we will lose sync in the protocol, hence uninterruptibleMask.
    
    212 214
     
    
    213 215
     dieWithUsage :: IO a
    
    214 216
     dieWithUsage = do