diff options
author | Simon Marlow <simonmar@microsoft.com> | 2007-07-24 15:30:57 +0000 |
---|---|---|
committer | Simon Marlow <simonmar@microsoft.com> | 2007-07-24 15:30:57 +0000 |
commit | 681aad99cb29ce54f72ec2a916fb1aab0fa0fabb (patch) | |
tree | 65e13d3bc1acad8b859e63886c5e5ea429f7236f /rts/Capability.h | |
parent | 1bd1fb932375bc4b065cc8de23f0d251e8075395 (diff) | |
download | haskell-681aad99cb29ce54f72ec2a916fb1aab0fa0fabb.tar.gz |
hs_exit()/shutdownHaskell(): wait for outstanding foreign calls to complete before returning
This is pertinent to #1177. When shutting down a DLL, we need to be
sure that there are no OS threads that can return to the code that we
are about to unload, and previously the threaded RTS was unsafe in
this respect.
When exiting a standalone program we don't have to be quite so
paranoid: all the code will disappear at the same time as any running
threads. Happily exiting a program happens via a different path:
shutdownHaskellAndExit(). If we're about to exit(), then there's no
need to wait for foreign calls to complete.
Diffstat (limited to 'rts/Capability.h')
-rw-r--r-- | rts/Capability.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/Capability.h b/rts/Capability.h index dedd6351b6..c50fe7ffab 100644 --- a/rts/Capability.h +++ b/rts/Capability.h @@ -217,7 +217,7 @@ void prodAllCapabilities (void); // Waits for a capability to drain of runnable threads and workers, // and then acquires it. Used at shutdown time. // -void shutdownCapability (Capability *cap, Task *task); +void shutdownCapability (Capability *cap, Task *task, rtsBool wait_foreign); // Attempt to gain control of a Capability if it is free. // |