summaryrefslogtreecommitdiff
path: root/rts/RtsStartup.c
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2006-12-01 14:48:23 +0000
committerSimon Marlow <simonmar@microsoft.com>2006-12-01 14:48:23 +0000
commit80a766fdb6864eae613962e43ad9eb371e0ce80c (patch)
tree85bb6589d0b8f138b721f01d4b5337ff87ba9b11 /rts/RtsStartup.c
parentde6c8e5293c9ef68b597ab2e6d55c3f42a283489 (diff)
downloadhaskell-80a766fdb6864eae613962e43ad9eb371e0ce80c.tar.gz
Add support for the IO manager thread on Windows
Fixes #637. The implications of this change are: - threadDelay on Windows no longer creates a new OS thread each time, instead it communicates with the IO manager thread in the same way as on Unix. - deadlock detection now works the same way on Windows as on Unix; that is the timer interrupt wakes up the IO manager thread, which causes the scheduler to check for deadlock. - Console events now get sent to the IO manager thread, in the same way as signals do on Unix. This means that console events should behave more reliably with -threaded on Windows. All this applies only with -threaded. Without -threaded, the old ConsoleEvent code is still used. After some testing, this could be pushed to the 6.6 branch.
Diffstat (limited to 'rts/RtsStartup.c')
-rw-r--r--rts/RtsStartup.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c
index dba529bb20..824ef98101 100644
--- a/rts/RtsStartup.c
+++ b/rts/RtsStartup.c
@@ -19,6 +19,7 @@
#include "STM.h" /* initSTM */
#include "Signals.h"
#include "RtsSignals.h"
+#include "ThrIOManager.h"
#include "Timer.h" /* startTimer, stopTimer */
#include "Weak.h"
#include "Ticky.h"
@@ -268,7 +269,7 @@ hs_init(int *argc, char **argv[])
x86_init_fpu();
#endif
-#if defined(THREADED_RTS) && !defined(mingw32_HOST_OS)
+#if defined(THREADED_RTS)
ioManagerStart();
#endif
@@ -371,7 +372,7 @@ hs_exit(void)
/* start timing the shutdown */
stat_startExit();
-#if defined(THREADED_RTS) && !defined(mingw32_HOST_OS)
+#if defined(THREADED_RTS)
ioManagerDie();
#endif