[commit: base] : Avoid use of backend modifyFdOnce in Poll backend in unregisterFd_. (80b16a4)

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


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

On branch  : 

http://hackage.haskell.org/trac/ghc/changeset/80b16a410889fd86e991a2eca0a2ef066dd6c929

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

commit 80b16a410889fd86e991a2eca0a2ef066dd6c929
Author: Andreas Voellmy <andreas.voellmy at gmail.com>
Date:   Thu Jan 3 22:39:34 2013 -0500

    Avoid use of backend modifyFdOnce in Poll backend in unregisterFd_.

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

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

diff --git a/GHC/Event/Manager.hs b/GHC/Event/Manager.hs
index 74152dd..02feafb 100644
--- a/GHC/Event/Manager.hs
+++ b/GHC/Event/Manager.hs
@@ -330,9 +330,12 @@ unregisterFd_ mgr@(EventManager{..}) (FdKey fd u) =
               (Just prev, newm) -> (newm, pairEvents prev newm fd')
         modify = oldEvs /= newEvs
     when modify $
+#if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE)    
       if emOneShot && newEvs /= mempty
       then I.modifyFdOnce emBackend fd newEvs
-      else I.modifyFd emBackend fd oldEvs newEvs
+      else
+#endif        
+        I.modifyFd emBackend fd oldEvs newEvs
     return (newMap, modify)
 
 -- | Drop a previous file descriptor registration.





More information about the ghc-commits mailing list