summaryrefslogtreecommitdiff
path: root/rts/win32/ConsoleHandler.h
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/win32/ConsoleHandler.h
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/win32/ConsoleHandler.h')
-rw-r--r--rts/win32/ConsoleHandler.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/rts/win32/ConsoleHandler.h b/rts/win32/ConsoleHandler.h
index b09adf71cb..33fa065733 100644
--- a/rts/win32/ConsoleHandler.h
+++ b/rts/win32/ConsoleHandler.h
@@ -9,9 +9,16 @@
* Console control handlers lets an application handle Ctrl+C, Ctrl+Break etc.
* in Haskell under Win32. Akin to the Unix signal SIGINT.
*
- * The API offered by ConsoleHandler.h is identical to that of the signal handling
- * code (which isn't supported under win32.) Unsurprisingly, the underlying impl
- * is derived from the signal handling code also.
+ * The API offered by ConsoleHandler.h is identical to that of the
+ * signal handling code (which isn't supported under win32.)
+ * Unsurprisingly, the underlying impl is derived from the signal
+ * handling code also.
+ */
+
+#if !defined(THREADED_RTS)
+/*
+ * under THREADED_RTS, console events are passed to the IO manager
+ * thread, which starts up the handler. See ThrIOManager.c.
*/
/*
@@ -60,4 +67,6 @@ extern void handleSignalsInThisThread(void);
*/
extern int rts_waitConsoleHandlerCompletion(void);
+#endif /* THREADED_RTS */
+
#endif /* __CONSOLEHANDLER_H__ */