[commit: base] master: Workaround buggy kqueue on os x. (bcf8724)

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


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

On branch  : master

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

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

commit bcf8724642f3cec73587313878047c87fd61e18f
Author: Andreas Voellmy <andreas.voellmy at gmail.com>
Date:   Fri Feb 8 00:47:46 2013 -0500

    Workaround buggy kqueue on os x.
    
    On OS X, set haveOneShot = False and always wakeup the manager after a fd is registered.

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

 GHC/Event/Manager.hs |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/GHC/Event/Manager.hs b/GHC/Event/Manager.hs
index 4abadca..83b26d9 100644
--- a/GHC/Event/Manager.hs
+++ b/GHC/Event/Manager.hs
@@ -135,7 +135,9 @@ callbackTableVar mgr fd = emFds mgr ! hashFd fd
 
 haveOneShot :: Bool
 {-# INLINE haveOneShot #-}
-#if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
+#if defined(darwin_HOST_OS)
+haveOneShot = False    
+#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
 haveOneShot = True
 #else
 haveOneShot = False
@@ -316,7 +318,9 @@ registerFd mgr cb fd evs = do
 
 -- | Wake up the event manager.
 wakeManager :: EventManager -> IO ()
-#if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
+#if defined(darwin_HOST_OS)
+wakeManager mgr = sendWakeup (emControl mgr)    
+#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)
 wakeManager _ = return ()
 #else
 wakeManager mgr = sendWakeup (emControl mgr)





More information about the ghc-commits mailing list