[commit: base] master: Removed control registration flag from Manager and TimerManager new functions. (9b61a8b)

Johan Tibell johan.tibell at gmail.com
Tue Feb 12 07:49:53 CET 2013


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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/9b61a8bcc818ef574b355eac0cdeba9e4f91ed39

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

commit 9b61a8bcc818ef574b355eac0cdeba9e4f91ed39
Author: Andreas Voellmy <andreas.voellmy at gmail.com>
Date:   Thu Dec 20 01:21:24 2012 -0500

    Removed control registration flag from Manager and TimerManager new functions.
    
    The timer manager always registers its control instance with the RTS hooks while the file io manager does not.

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

 GHC/Event/Manager.hs      |   10 +++++-----
 GHC/Event/Thread.hs       |    4 ++--
 GHC/Event/TimerManager.hs |   10 +++++-----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/GHC/Event/Manager.hs b/GHC/Event/Manager.hs
index 0ecd271..a4ac08f 100644
--- a/GHC/Event/Manager.hs
+++ b/GHC/Event/Manager.hs
@@ -180,14 +180,14 @@ newDefaultBackend = error "no back end for this platform"
 #endif
 
 -- | Create a new event manager.
-new :: Bool -> IO EventManager
-new shouldRegister = newWith shouldRegister =<< newDefaultBackend
+new :: IO EventManager
+new = newWith =<< newDefaultBackend
 
-newWith :: Bool -> Backend -> IO EventManager
-newWith shouldRegister be = do
+newWith :: Backend -> IO EventManager
+newWith be = do
   iofds <- newMVar IM.empty
   timeouts <- newIORef id
-  ctrl <- newControl shouldRegister
+  ctrl <- newControl False
   state <- newIORef Created
   us <- newSource
   _ <- mkWeakIORef state $ do
diff --git a/GHC/Event/Thread.hs b/GHC/Event/Thread.hs
index 3613476..4371815 100644
--- a/GHC/Event/Thread.hs
+++ b/GHC/Event/Thread.hs
@@ -200,7 +200,7 @@ ensureIOManagerIsRunning
 startIOManagerThread :: IO ()
 startIOManagerThread = modifyMVar_ ioManager $ \old -> do
   let create = do
-        !mgr <- new False
+        !mgr <- new
         writeIORef eventManager $ Just mgr
         !t <- forkIO $ loop mgr
         labelThread t "IOManager"
@@ -232,7 +232,7 @@ startTimerManagerThread = modifyMVar_ timerManagerThreadVar $ \old -> do
           Nothing -> return ()
           Just em -> M.shutdown em
   let create = do
-        !mgr <- TM.new True
+        !mgr <- TM.new
         writeIORef timerManager $ Just mgr
         !t <- forkIO $ TM.loop mgr `finally` shutdownEM
         labelThread t "TimerManager"
diff --git a/GHC/Event/TimerManager.hs b/GHC/Event/TimerManager.hs
index 4bf59c5..5262e20 100644
--- a/GHC/Event/TimerManager.hs
+++ b/GHC/Event/TimerManager.hs
@@ -149,13 +149,13 @@ newDefaultBackend = error "no back end for this platform"
 #endif
 
 -- | Create a new event manager.
-new :: Bool -> IO TimerManager
-new shouldRegister = newWith shouldRegister =<< newDefaultBackend
+new :: IO TimerManager
+new = newWith =<< newDefaultBackend
 
-newWith :: Bool -> Backend -> IO TimerManager
-newWith shouldRegister be = do
+newWith :: Backend -> IO TimerManager
+newWith be = do
   timeouts <- newIORef id
-  ctrl <- newControl shouldRegister
+  ctrl <- newControl True
   state <- newIORef Created
   us <- newSource
   _ <- mkWeakIORef state $ do





More information about the ghc-commits mailing list