projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add getNumCapabilities :: IO Int
[ghc-base.git]
/
Data
/
IORef.hs
diff --git
a/Data/IORef.hs
b/Data/IORef.hs
index
70ea4b1
..
a6f29e7
100644
(file)
--- a/
Data/IORef.hs
+++ b/
Data/IORef.hs
@@
-1,4
+1,5
@@
-{-# OPTIONS_GHC -XNoImplicitPrelude #-}
+{-# LANGUAGE CPP, NoImplicitPrelude, MagicHash, UnboxedTuples #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : Data.IORef
-----------------------------------------------------------------------------
-- |
-- Module : Data.IORef
@@
-35,7
+36,9
@@
import Hugs.IORef
#ifdef __GLASGOW_HASKELL__
import GHC.Base
import GHC.STRef
#ifdef __GLASGOW_HASKELL__
import GHC.Base
import GHC.STRef
-import GHC.IOBase
+-- import GHC.IO
+import GHC.IORef hiding (atomicModifyIORef)
+import qualified GHC.IORef
#if !defined(__PARALLEL_HASKELL__)
import GHC.Weak
#endif
#if !defined(__PARALLEL_HASKELL__)
import GHC.Weak
#endif
@@
-75,7
+78,7
@@
modifyIORef ref f = readIORef ref >>= writeIORef ref . f
--
atomicModifyIORef :: IORef a -> (a -> (a,b)) -> IO b
#if defined(__GLASGOW_HASKELL__)
--
atomicModifyIORef :: IORef a -> (a -> (a,b)) -> IO b
#if defined(__GLASGOW_HASKELL__)
-atomicModifyIORef (IORef (STRef r#)) f = IO $ \s -> atomicModifyMutVar# r# f s
+atomicModifyIORef = GHC.IORef.atomicModifyIORef
#elif defined(__HUGS__)
atomicModifyIORef = plainModifyIORef -- Hugs has no preemption
#elif defined(__HUGS__)
atomicModifyIORef = plainModifyIORef -- Hugs has no preemption