diff options
author | David Feuer <david.feuer@gmail.com> | 2018-07-15 10:15:15 -0400 |
---|---|---|
committer | David Feuer <David.Feuer@gmail.com> | 2018-07-15 10:15:16 -0400 |
commit | af9b744bbf1c39078e561b19edd3c5234b361b27 (patch) | |
tree | 1e09db1499b2040043cd8d23ecb006539991a36c /libraries/base/GHC/Event/Control.hs | |
parent | 8a70ccbb552191e1972f3c5d7fce839176c4c0e3 (diff) | |
download | haskell-af9b744bbf1c39078e561b19edd3c5234b361b27.tar.gz |
Replace atomicModifyMutVar#
Reviewers: simonmar, hvr, bgamari, erikd, fryguybob, rrnewton
Reviewed By: simonmar
Subscribers: fryguybob, rwbarton, thomie, carter
GHC Trac Issues: #15364
Differential Revision: https://phabricator.haskell.org/D4884
Diffstat (limited to 'libraries/base/GHC/Event/Control.hs')
-rw-r--r-- | libraries/base/GHC/Event/Control.hs | 2 |
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) |