[commit: ghc] master: shutdownHaskellAndExit: just do a normal hs_exit() (#5402) (9cbcdb4)

git at git.haskell.org git at git.haskell.org
Fri Sep 23 04:40:03 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/9cbcdb4863064753df0fff9054b7b7c6b3188b64/ghc

>---------------------------------------------------------------

commit 9cbcdb4863064753df0fff9054b7b7c6b3188b64
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Thu Sep 15 15:53:00 2016 +0100

    shutdownHaskellAndExit: just do a normal hs_exit() (#5402)
    
    If we want to keep the RTS alive a bit longer by having another
    hs_init()/hs_exit() pair in a library that will destruct itself after
    main() has exited, then the forced shutdown here thwarts that.
    
    I think we just "fixed" #5402 in the wrong way before, this should be
    better.


>---------------------------------------------------------------

9cbcdb4863064753df0fff9054b7b7c6b3188b64
 rts/RtsStartup.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c
index 123fb9b..33ffb83 100644
--- a/rts/RtsStartup.c
+++ b/rts/RtsStartup.c
@@ -466,10 +466,6 @@ void
 shutdownHaskellAndExit(int n, int fastExit)
 {
     if (!fastExit) {
-        // even if hs_init_count > 1, we still want to shut down the RTS
-        // and exit immediately (see #5402)
-        hs_init_count = 1;
-
         // we're about to exit(), no need to wait for foreign calls to return.
         hs_exit_(rtsFalse);
     }



More information about the ghc-commits mailing list