|
| 1 | +From 41117d71bb58e001f6a2b6a11c9314d5b70b9182 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Ben Gamari < [email protected]> |
| 3 | +Date: Thu, 23 Jan 2020 14:11:20 -0500 |
| 4 | +Subject: [PATCH] base: Use one-shot kqueue on macOS |
| 5 | + |
| 6 | +The underlying reason requiring that one-shot usage be disabled (#13903) |
| 7 | +has been fixed. |
| 8 | + |
| 9 | +Closes #15768. |
| 10 | +--- |
| 11 | + libraries/base/GHC/Event/Manager.hs | 17 ++--------------- |
| 12 | + 1 file changed, 2 insertions(+), 15 deletions(-) |
| 13 | + |
| 14 | +diff --git a/libraries/base/GHC/Event/Manager.hs b/libraries/base/GHC/Event/Manager.hs |
| 15 | +index eda3e61490..51306795fe 100644 |
| 16 | +--- a/libraries/base/GHC/Event/Manager.hs |
| 17 | ++++ b/libraries/base/GHC/Event/Manager.hs |
| 18 | +@@ -150,9 +150,7 @@ callbackTableVar mgr fd = emFds mgr ! hashFd fd |
| 19 | + |
| 20 | + haveOneShot :: Bool |
| 21 | + {-# INLINE haveOneShot #-} |
| 22 | +-#if defined(darwin_HOST_OS) || defined(ios_HOST_OS) |
| 23 | +-haveOneShot = False |
| 24 | +-#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE) |
| 25 | ++#if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE) |
| 26 | + haveOneShot = True |
| 27 | + #else |
| 28 | + haveOneShot = False |
| 29 | +@@ -365,20 +363,9 @@ registerFd mgr cb fd evs lt = do |
| 30 | + return r |
| 31 | + {-# INLINE registerFd #-} |
| 32 | + |
| 33 | +-{- |
| 34 | +- Building GHC with parallel IO manager on Mac freezes when |
| 35 | +- compiling the dph libraries in the phase 2. As workaround, we |
| 36 | +- don't use oneshot and we wake up an IO manager on Mac every time |
| 37 | +- when we register an event. |
| 38 | +- |
| 39 | +- For more information, please read: |
| 40 | +- http://ghc.haskell.org/trac/ghc/ticket/7651 |
| 41 | +--} |
| 42 | + -- | Wake up the event manager. |
| 43 | + wakeManager :: EventManager -> IO () |
| 44 | +-#if defined(darwin_HOST_OS) || defined(ios_HOST_OS) |
| 45 | +-wakeManager mgr = sendWakeup (emControl mgr) |
| 46 | +-#elif defined(HAVE_EPOLL) || defined(HAVE_KQUEUE) |
| 47 | ++#if defined(HAVE_EPOLL) || defined(HAVE_KQUEUE) |
| 48 | + wakeManager _ = return () |
| 49 | + #else |
| 50 | + wakeManager mgr = sendWakeup (emControl mgr) |
| 51 | +-- |
| 52 | +2.25.0 |
0 commit comments