diff options
author | Duncan Coutts <duncan@well-typed.com> | 2021-01-03 18:37:51 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-01-25 05:11:14 -0500 |
commit | e3564e3893c90dc20aa1949cdb85f41741faf895 (patch) | |
tree | f7988daba467d3b84923e392326ad7607896148c /rts/IOManager.h | |
parent | 9a7d19ba0a3a3e2f9a0ffa270895d09c912240f0 (diff) | |
download | haskell-e3564e3893c90dc20aa1949cdb85f41741faf895.tar.gz |
Add a common wakeupIOManager hook
Use in the scheduler in threaded mode.
Replaces the direct call to ioManagerWakeup which are part of specific
I/O manager implementations.
Diffstat (limited to 'rts/IOManager.h')
-rw-r--r-- | rts/IOManager.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/rts/IOManager.h b/rts/IOManager.h index 1059f4212e..614c3ac9c7 100644 --- a/rts/IOManager.h +++ b/rts/IOManager.h @@ -48,6 +48,24 @@ void initIOManagerAfterFork(/* inout */ Capability **pcap); void stopIOManager(void); void exitIOManager(bool wait_threads); + +/* Wakeup hook: called from the scheduler's wakeUpRts (currently only in + * threaded mode). + * + * The I/O manager can be blocked waiting on I/O or timers. Sometimes there are + * other external events where we need to wake up the I/O manager and return + * to the schedulr. + * + * At the moment, all the non-threaded I/O managers will do this automagically + * since a signal will interrupt any waiting system calls, so at the moment + * the implementation for the non-threaded I/O managers does nothing. + * + * For the I/O managers in threaded mode, this arranges to unblock the I/O + * manager if it waa blocked waiting. + */ +void wakeupIOManager(void); + + /* * Communicating with the IO manager thread (see GHC.Conc). * Posix implementation in posix/Signals.c |