summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2019-06-16 21:30:14 +0100
committerBen Gamari <ben@smart-cactus.org>2020-07-15 16:41:01 -0400
commit4bf542bf1cdf2fa468457fc0af21333478293476 (patch)
tree8378f0fa182d8e829e15fc5d102ba01aa8bd038e /includes
parent050da6dd42d0cb293c7fce4a5ccdeb5abe1aadb4 (diff)
downloadhaskell-4bf542bf1cdf2fa468457fc0af21333478293476.tar.gz
winio: Multiple refactorings and support changes.
Diffstat (limited to 'includes')
-rw-r--r--includes/rts/FileLock.h6
-rw-r--r--includes/rts/IOManager.h19
2 files changed, 17 insertions, 8 deletions
diff --git a/includes/rts/FileLock.h b/includes/rts/FileLock.h
index 978ccf86b6..84f1f63881 100644
--- a/includes/rts/FileLock.h
+++ b/includes/rts/FileLock.h
@@ -15,5 +15,7 @@
#include "Stg.h"
-int lockFile(int fd, StgWord64 dev, StgWord64 ino, int for_writing);
-int unlockFile(int fd);
+/* No valid FD would be negative, so use a word instead of int so the value
+ is compatible with a Windows handle. */
+int lockFile(StgWord id, StgWord64 dev, StgWord64 ino, int for_writing);
+int unlockFile(StgWord id);
diff --git a/includes/rts/IOManager.h b/includes/rts/IOManager.h
index 603cb3f578..4c392e2058 100644
--- a/includes/rts/IOManager.h
+++ b/includes/rts/IOManager.h
@@ -15,6 +15,11 @@
#if defined(mingw32_HOST_OS)
+#define IO_MANAGER_WAKEUP 0xffffffff
+#define IO_MANAGER_DIE 0xfffffffe
+/* spurious wakeups are returned as zero. */
+/* console events are ((event<<1) | 1). */
+
int rts_InstallConsoleEvent ( int action, StgStablePtr *handler );
void rts_ConsoleHandlerDone ( int ev );
extern StgInt console_handler;
@@ -31,13 +36,15 @@ 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
-//
+/*
+ * 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)
+#if defined(THREADED_RTS) || defined(mingw32_HOST_OS)
void ioManagerDie (void);
void ioManagerStart (void);
#endif