[commit: base] : Added ioManagerCapabilitiesChanged function that is called from RTS to notify the IO manager that the number of capabilities has changed. (05d1a29)

Johan Tibell johan.tibell at gmail.com
Tue Feb 12 07:50:51 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/packages/base

On branch  : 

http://hackage.haskell.org/trac/ghc/changeset/05d1a297c7a7a86fdfd3e93b73cf3ad90e6c063a

>---------------------------------------------------------------

commit 05d1a297c7a7a86fdfd3e93b73cf3ad90e6c063a
Author: Andreas Voellmy <andreas.voellmy at gmail.com>
Date:   Sat Dec 22 19:37:31 2012 -0500

    Added ioManagerCapabilitiesChanged function that is called from RTS to notify the IO manager that the number of capabilities has changed.

>---------------------------------------------------------------

 GHC/Conc.lhs        |    1 +
 GHC/Conc/IO.hs      |    8 ++++++++
 GHC/Event/Thread.hs |    4 ++++
 3 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/GHC/Conc.lhs b/GHC/Conc.lhs
index f5fb275..aa14b37 100644
--- a/GHC/Conc.lhs
+++ b/GHC/Conc.lhs
@@ -99,6 +99,7 @@ module GHC.Conc
 #endif
 
         , ensureIOManagerIsRunning
+        , ioManagerCapabilitiesChanged
 
 #ifdef mingw32_HOST_OS
         , ConsoleEvent(..)
diff --git a/GHC/Conc/IO.hs b/GHC/Conc/IO.hs
index 8faa9b5..98cdc61 100644
--- a/GHC/Conc/IO.hs
+++ b/GHC/Conc/IO.hs
@@ -32,6 +32,7 @@
 -- #not-home
 module GHC.Conc.IO
         ( ensureIOManagerIsRunning
+        , ioManagerCapabilitiesChanged
 
         -- * Waiting
         , threadDelay
@@ -78,6 +79,13 @@ ensureIOManagerIsRunning = Event.ensureIOManagerIsRunning
 ensureIOManagerIsRunning = Windows.ensureIOManagerIsRunning
 #endif
 
+ioManagerCapabilitiesChanged :: Int -> IO ()
+#ifndef mingw32_HOST_OS
+ioManagerCapabilitiesChanged = Event.ioManagerCapabilitiesChanged
+#else
+ioManagerCapabilitiesChanged = return ()
+#endif
+
 -- | Block the current thread until data is available to read on the
 -- given file descriptor (GHC only).
 --
diff --git a/GHC/Event/Thread.hs b/GHC/Event/Thread.hs
index 9b19213..8c5989b 100644
--- a/GHC/Event/Thread.hs
+++ b/GHC/Event/Thread.hs
@@ -5,6 +5,7 @@ module GHC.Event.Thread
     ( getSystemEventManager
     , getSystemTimerManager
     , ensureIOManagerIsRunning
+    , ioManagerCapabilitiesChanged
     , threadWaitRead
     , threadWaitWrite
     , threadWaitReadSTM
@@ -283,3 +284,6 @@ shutdownManagers =
          Just (_,mgr) -> M.shutdown mgr
 
 foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool
+
+ioManagerCapabilitiesChanged :: Int -> IO ()
+ioManagerCapabilitiesChanged n = return ()





More information about the ghc-commits mailing list