From e93384e82fb4de5a5ee96949b7c1108bce16a875 Mon Sep 17 00:00:00 2001 From: Duncan Coutts <duncan@well-typed.com> Date: Sun, 3 Jan 2021 17:00:11 +0000 Subject: [PATCH] Move ioManager{Start,Wakeup,Die} to internal IOManager.h Move them from the external IOInterface.h to the internal IOManager.h. The functions are all in fact internal. They are not used from the base library at all. Remove ioManagerWakeup as an exported symbol. It is not used elsewhere. --- includes/rts/IOInterface.h | 12 ------------ rts/Capability.c | 1 + rts/IOManager.h | 12 ++++++++++++ rts/RtsStartup.c | 1 + rts/RtsSymbols.c | 2 -- rts/Schedule.c | 1 + rts/posix/Signals.c | 1 + 7 files changed, 16 insertions(+), 14 deletions(-) diff --git a/includes/rts/IOInterface.h b/includes/rts/IOInterface.h index 4c392e2058ea..9a646cc5cf2b 100644 --- a/includes/rts/IOInterface.h +++ b/includes/rts/IOInterface.h @@ -36,15 +36,3 @@ void setIOManagerWakeupFd (int fd); #endif -/* - * 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 diff --git a/rts/Capability.c b/rts/Capability.c index a77112650aae..3ef604693bd2 100644 --- a/rts/Capability.c +++ b/rts/Capability.c @@ -29,6 +29,7 @@ #include "RtsUtils.h" #include "sm/OSMem.h" #include "sm/BlockAlloc.h" // for countBlocks() +#include "IOManager.h" #include <string.h> diff --git a/rts/IOManager.h b/rts/IOManager.h index da322c6e4064..713049305fc5 100644 --- a/rts/IOManager.h +++ b/rts/IOManager.h @@ -21,5 +21,17 @@ #include "BeginPrivate.h" +/* + * 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 #include "EndPrivate.h" diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c index 79c830f96d1c..7916ad61c80b 100644 --- a/rts/RtsStartup.c +++ b/rts/RtsStartup.c @@ -46,6 +46,7 @@ # include "RetainerProfile.h" #endif +#include "IOManager.h" #if defined(mingw32_HOST_OS) && !defined(THREADED_RTS) #include "win32/AsyncMIO.h" #include "win32/AsyncWinIO.h" diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c index 7cd62faabe57..a3ee8505aea5 100644 --- a/rts/RtsSymbols.c +++ b/rts/RtsSymbols.c @@ -341,7 +341,6 @@ SymI_HasProto(setIOManagerControlFd) \ SymI_HasProto(setTimerManagerControlFd) \ SymI_HasProto(setIOManagerWakeupFd) \ - SymI_HasProto(ioManagerWakeup) \ SymI_HasProto(blockUserSignals) \ SymI_HasProto(unblockUserSignals) #else @@ -350,7 +349,6 @@ SymI_HasProto(getOverlappedEntries) \ SymI_HasProto(completeSynchronousRequest) \ SymI_HasProto(registerAlertableWait) \ - SymI_HasProto(ioManagerWakeup) \ SymI_HasProto(sendIOManagerEvent) \ SymI_HasProto(readIOManagerEvent) \ SymI_HasProto(getIOManagerEvent) \ diff --git a/rts/Schedule.c b/rts/Schedule.c index 514832ea6e9d..810a70973bf5 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -32,6 +32,7 @@ #include "Capability.h" #include "Task.h" #include "AwaitEvent.h" +#include "IOManager.h" #if defined(mingw32_HOST_OS) #include "win32/MIOManager.h" #include "win32/AsyncWinIO.h" diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c index 57b1873c779e..185c69eee396 100644 --- a/rts/posix/Signals.c +++ b/rts/posix/Signals.c @@ -12,6 +12,7 @@ #include "Schedule.h" #include "RtsSignals.h" #include "Signals.h" +#include "IOManager.h" #include "RtsUtils.h" #include "Prelude.h" #include "Ticker.h" -- GitLab