projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix some "warn-unused-do-bind" warnings where we just want to ignore the result
[ghc-base.git]
/
Control
/
Concurrent.hs
diff --git
a/Control/Concurrent.hs
b/Control/Concurrent.hs
index
b9e52cb
..
2d9cf57
100644
(file)
--- a/
Control/Concurrent.hs
+++ b/
Control/Concurrent.hs
@@
-1,3
+1,4
@@
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-----------------------------------------------------------------------------
-- |
-- Module : Control.Concurrent
-----------------------------------------------------------------------------
-- |
-- Module : Control.Concurrent
@@
-99,10
+100,8
@@
import GHC.Exception
import GHC.Conc ( ThreadId(..), myThreadId, killThread, yield,
threadDelay, forkIO, childHandler )
import qualified GHC.Conc
import GHC.Conc ( ThreadId(..), myThreadId, killThread, yield,
threadDelay, forkIO, childHandler )
import qualified GHC.Conc
-import GHC.TopHandler ( reportStackOverflow, reportError )
-import GHC.IOBase ( IO(..) )
-import GHC.IOBase ( unsafeInterleaveIO )
-import GHC.IOBase ( newIORef, readIORef, writeIORef )
+import GHC.IO ( IO(..), unsafeInterleaveIO )
+import GHC.IORef ( newIORef, readIORef, writeIORef )
import GHC.Base
import System.Posix.Types ( Fd )
import GHC.Base
import System.Posix.Types ( Fd )
@@
-113,7
+112,6
@@
import Control.Monad ( when )
#ifdef mingw32_HOST_OS
import Foreign.C
import System.IO
#ifdef mingw32_HOST_OS
import Foreign.C
import System.IO
-import GHC.Handle
#endif
#endif
#endif
#endif
@@
-344,6
+342,7
@@
foreign export ccall forkOS_entry
foreign import ccall "forkOS_entry" forkOS_entry_reimported
:: StablePtr (IO ()) -> IO ()
foreign import ccall "forkOS_entry" forkOS_entry_reimported
:: StablePtr (IO ()) -> IO ()
+forkOS_entry :: StablePtr (IO ()) -> IO ()
forkOS_entry stableAction = do
action <- deRefStablePtr stableAction
action
forkOS_entry stableAction = do
action <- deRefStablePtr stableAction
action
@@
-351,6
+350,7
@@
forkOS_entry stableAction = do
foreign import ccall forkOS_createThread
:: StablePtr (IO ()) -> IO CInt
foreign import ccall forkOS_createThread
:: StablePtr (IO ()) -> IO CInt
+failNonThreaded :: IO a
failNonThreaded = fail $ "RTS doesn't support multiple OS threads "
++"(use ghc -threaded when linking)"
failNonThreaded = fail $ "RTS doesn't support multiple OS threads "
++"(use ghc -threaded when linking)"
@@
-431,7
+431,7
@@
runInUnboundThread action = do
then do
mv <- newEmptyMVar
forkIO (Exception.try action >>= putMVar mv)
then do
mv <- newEmptyMVar
forkIO (Exception.try action >>= putMVar mv)
- takeMVar mv >>= \either -> case either of
+ takeMVar mv >>= \ei -> case ei of
Left exception -> Exception.throw (exception :: SomeException)
Right result -> return result
else action
Left exception -> Exception.throw (exception :: SomeException)
Right result -> return result
else action
@@
-490,7
+490,8
@@
waitFd fd write = do
fdReady (fromIntegral fd) write (fromIntegral iNFINITE) 0
return ()
fdReady (fromIntegral fd) write (fromIntegral iNFINITE) 0
return ()
-iNFINITE = 0xFFFFFFFF :: CInt -- urgh
+iNFINITE :: CInt
+iNFINITE = 0xFFFFFFFF -- urgh
foreign import ccall safe "fdReady"
fdReady :: CInt -> CInt -> CInt -> CInt -> IO CInt
foreign import ccall safe "fdReady"
fdReady :: CInt -> CInt -> CInt -> CInt -> IO CInt
@@
-522,7
+523,7
@@
foreign import ccall safe "fdReady"
The "System.IO" library manages multiplexing in its own way. On
Windows systems it uses @safe@ foreign calls to ensure that
threads doing I\/O operations don't block the whole runtime,
The "System.IO" library manages multiplexing in its own way. On
Windows systems it uses @safe@ foreign calls to ensure that
threads doing I\/O operations don't block the whole runtime,
- whereas on Unix systems all the currently blocked I\/O reqwests
+ whereas on Unix systems all the currently blocked I\/O requests
are managed by a single thread (the /IO manager thread/) using
@select@.
are managed by a single thread (the /IO manager thread/) using
@select@.