summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2021-01-03 18:44:19 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-01-25 05:11:14 -0500
commit34a8a0e4cf188a30d2b4b65909f24185c80d071e (patch)
treea8c25a0f4112f0dbe1a7a9969be577071d252094
parente3564e3893c90dc20aa1949cdb85f41741faf895 (diff)
downloadhaskell-34a8a0e4cf188a30d2b4b65909f24185c80d071e.tar.gz
Remove ioManager{Start,Die,Wakeup} from IOManager.h
They are not part of the IOManager interface used within the rest of the RTS. They are the part of the interface of specific I/O manager implementations. They are no longer called directly elsewhere in the RTS, and are now only called by the dispatch functions in IOManager.c
-rw-r--r--rts/IOManager.c6
-rw-r--r--rts/IOManager.h13
-rw-r--r--rts/posix/Signals.h10
-rw-r--r--rts/win32/AsyncWinIO.c1
-rw-r--r--rts/win32/ThrIOManager.c1
-rw-r--r--rts/win32/ThrIOManager.h18
6 files changed, 34 insertions, 15 deletions
diff --git a/rts/IOManager.c b/rts/IOManager.c
index da1d71dd15..5551e2e2cd 100644
--- a/rts/IOManager.c
+++ b/rts/IOManager.c
@@ -19,12 +19,14 @@
#include "rts/IOInterface.h" // exported
#include "IOManager.h" // RTS internal
#include "Capability.h"
+#include "RtsFlags.h"
-#if !defined(mingw32_HOST_OS) && defined(THREADED_RTS)
+#if !defined(mingw32_HOST_OS)
#include "posix/Signals.h"
#endif
-#if defined(mingw32_HOST_OS) && !defined(THREADED_RTS)
+#if defined(mingw32_HOST_OS)
+#include "win32/ThrIOManager.h"
#include "win32/AsyncMIO.h"
#include "win32/AsyncWinIO.h"
#endif
diff --git a/rts/IOManager.h b/rts/IOManager.h
index 614c3ac9c7..f7523149c3 100644
--- a/rts/IOManager.h
+++ b/rts/IOManager.h
@@ -66,19 +66,6 @@ void exitIOManager(bool wait_threads);
void wakeupIOManager(void);
-/*
- * Communicating with the IO manager thread (see GHC.Conc).
- * Posix implementation in posix/Signals.c
- * Win32 implementation in win32/ThrIOManager.c, Windows's WINIO has the same
- * interfaces for Threaded and Non-threaded I/O, so these methods are always
- * available for WINIO.
-*/
-void ioManagerWakeup (void);
-#if defined(THREADED_RTS) || defined(mingw32_HOST_OS)
-void ioManagerDie (void);
-void ioManagerStart (void);
-#endif
-
/* Pedantic warning cleanliness
*/
#if !defined(THREADED_RTS) && defined(mingw32_HOST_OS)
diff --git a/rts/posix/Signals.h b/rts/posix/Signals.h
index 208c773a04..8203f28b34 100644
--- a/rts/posix/Signals.h
+++ b/rts/posix/Signals.h
@@ -27,7 +27,17 @@ void startSignalHandlers(Capability *cap);
void install_vtalrm_handler(int sig, TickProc handle_tick);
+/* Communicating with the IO manager thread (see GHC.Conc).
+ *
+ * TODO: these I/O manager things are not related to signals and ought to live
+ * elsewhere, e.g. in a module specifically for the I/O manager.
+ */
+void ioManagerWakeup (void);
+#if defined(THREADED_RTS)
+void ioManagerDie (void);
+void ioManagerStart (void);
void ioManagerStartCap (/* inout */ Capability **cap);
+#endif
extern StgInt *signal_handlers;
diff --git a/rts/win32/AsyncWinIO.c b/rts/win32/AsyncWinIO.c
index f6921fd4e5..0c0b45e60f 100644
--- a/rts/win32/AsyncWinIO.c
+++ b/rts/win32/AsyncWinIO.c
@@ -10,6 +10,7 @@
#include "Rts.h"
#include <rts/IOInterface.h>
+#include "ThrIOManager.h"
#include "AsyncWinIO.h"
#include "Prelude.h"
#include "Capability.h"
diff --git a/rts/win32/ThrIOManager.c b/rts/win32/ThrIOManager.c
index 039d62fad3..b29bf1072e 100644
--- a/rts/win32/ThrIOManager.c
+++ b/rts/win32/ThrIOManager.c
@@ -9,6 +9,7 @@
* ---------------------------------------------------------------------------*/
#include "Rts.h"
+#include "ThrIOManager.h"
#include "MIOManager.h"
#include "rts\OSThreads.h"
#include "Prelude.h"
diff --git a/rts/win32/ThrIOManager.h b/rts/win32/ThrIOManager.h
new file mode 100644
index 0000000000..a67bdde364
--- /dev/null
+++ b/rts/win32/ThrIOManager.h
@@ -0,0 +1,18 @@
+/* -----------------------------------------------------------------------------
+ *
+ * (c) The GHC Team, 1998-2006
+ *
+ * The IO manager thread in THREADED_RTS.
+ * See also libraries/base/GHC/Conc.hs.
+ *
+ * NOTE: This is used by both MIO and WINIO
+ * ---------------------------------------------------------------------------*/
+
+#pragma once
+
+/* Communicating with the IO manager thread (see GHC.Conc).
+ */
+void ioManagerWakeup (void);
+void ioManagerDie (void);
+void ioManagerStart (void);
+