hs_exit()/shutdownHaskell(): wait for outstanding foreign calls to complete before...
[ghc-hetmet.git] / rts / Schedule.c
index 441e979..afd8c28 100644 (file)
@@ -2577,7 +2577,8 @@ initScheduler(void)
 }
 
 void
-exitScheduler( void )
+exitScheduler( rtsBool wait_foreign )
+               /* see Capability.c, shutdownCapability() */
 {
     Task *task = NULL;
 
@@ -2599,7 +2600,7 @@ exitScheduler( void )
        nat i;
        
        for (i = 0; i < n_capabilities; i++) {
-           shutdownCapability(&capabilities[i], task);
+           shutdownCapability(&capabilities[i], task, wait_foreign);
        }
        boundTaskExiting(task);
        stopTaskManager();