summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Event/Control.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/GHC/Event/Control.hs')
-rw-r--r--libraries/base/GHC/Event/Control.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/libraries/base/GHC/Event/Control.hs b/libraries/base/GHC/Event/Control.hs
index 5b4a81b38b..779d60d5d7 100644
--- a/libraries/base/GHC/Event/Control.hs
+++ b/libraries/base/GHC/Event/Control.hs
@@ -126,7 +126,7 @@ newControl shouldRegister = allocaArray 2 $ \fds -> do
-- file after it has been closed.
closeControl :: Control -> IO ()
closeControl w = do
- atomicModifyIORef (controlIsDead w) (\_ -> (True, ()))
+ _ <- atomicSwapIORef (controlIsDead w) True
_ <- c_close . fromIntegral . controlReadFd $ w
_ <- c_close . fromIntegral . controlWriteFd $ w
when (didRegisterWakeupFd w) $ c_setIOManagerWakeupFd (-1)