+#if defined(THREADED_RTS)
+void
+ioManagerWakeup (void)
+{
+ // Wake up the IO Manager thread by sending a byte down its pipe
+ if (io_manager_pipe >= 0) {
+ StgWord8 byte = (StgWord8)IO_MANAGER_WAKEUP;
+ write(io_manager_pipe, &byte, 1);
+ }
+}
+
+void
+ioManagerDie (void)
+{
+ // Ask the IO Manager thread to exit
+ if (io_manager_pipe >= 0) {
+ StgWord8 byte = (StgWord8)IO_MANAGER_DIE;
+ write(io_manager_pipe, &byte, 1);
+ }
+}
+
+void
+ioManagerStart (void)
+{
+ // Make sure the IO manager thread is running
+ Capability *cap;
+ if (io_manager_pipe < 0) {
+ cap = rts_lock();
+ rts_evalIO(cap,&base_GHCziConc_ensureIOManagerIsRunning_closure,NULL);
+ rts_unlock(cap);
+ }
+}
+#endif
+