Skip to content
  • Jonas Termansen's avatar
    Fix pid 1 deadlocking when exiting with children. · 62bd9bf9
    Jonas Termansen authored
    The child processes of pid 1 were being reparented to pid 1, causing an
    infinite loop. This change fixes the problem by adding a hook that runs in
    the last thread about to exit in a process. When pid 1 exits, the hook will
    prevent more processes and threads from being created, and then broadcast
    kill all processes and threads. The hook is not run in LastPrayer(), as that
    function runs in a worker thread and it can't block waiting for another
    thread to run LastPrayer() in the same thread.
    62bd9bf9