[commit: base] : Minor refactoring: pass eventManagerArray to startIOManagerThread. (d22d04e)

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


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

On branch  : 

http://hackage.haskell.org/trac/ghc/changeset/d22d04ea9d70760257ba88069dbb10b821569917

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

commit d22d04ea9d70760257ba88069dbb10b821569917
Author: Andreas Voellmy <andreas.voellmy at gmail.com>
Date:   Sat Dec 22 20:35:33 2012 -0500

    Minor refactoring: pass eventManagerArray to startIOManagerThread.

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

 GHC/Event/Thread.hs |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/GHC/Event/Thread.hs b/GHC/Event/Thread.hs
index d0b75fc..85a0372 100644
--- a/GHC/Event/Thread.hs
+++ b/GHC/Event/Thread.hs
@@ -225,11 +225,12 @@ startIOManagerThreads = do
   eventManagerArray <- readIORef eventManager
   let (low, high) = boundsIOArray eventManagerArray
   withMVar ioManagerLock $ \_ ->
-    forM_ [low..high] startIOManagerThread
+    forM_ [low..high] (startIOManagerThread eventManagerArray)
   
-startIOManagerThread :: Int -> IO ()
-startIOManagerThread i = do
-  eventManagerArray <- readIORef eventManager
+startIOManagerThread :: IOArray Int (Maybe (ThreadId, EventManager))
+                        -> Int
+                        -> IO ()
+startIOManagerThread eventManagerArray i = do
   let create = do
         !mgr <- new True
         !t <- forkOn i $ loop mgr





More information about the ghc-commits mailing list