Skip to content
  • AndreasVoellmy's avatar
    rts/base: Fix #9423 · f9f89b78
    AndreasVoellmy authored
    Summary:
    Fix #9423.
    
    The problem in #9423 is caused when code invoked by `hs_exit()` waits
    on all foreign calls to return, but some IO managers are in `safe` foreign
    calls and do not return. The previous design signaled to the timer manager
    (via its control pipe) that it should "die" and when the timer manager
    returned to Haskell-land, the Haskell code in timer manager then signalled
    to the IO manager threads that they should return from foreign calls and
    `die`. Unfortunately, in the shutdown sequence the timer manager is unable
    to return to Haskell-land fast enough and so the code that signals to the
    IO manager threads (via their control pipes) is never executed and the IO
    manager threads remain out in the foreign calls.
    
    This patch solves this problem by having the RTS signal to all the IO
    manager threads (via their control pipes; and in addition to signalling
    to the timer manager thread) that they should shutdown (in `ioManagerDie()`
    in `rts/Signals.c`. To do this, we arrange for ea...
    f9f89b78