summaryrefslogtreecommitdiff
path: root/libraries/base/Control/Concurrent.hs
diff options
context:
space:
mode:
authorAdam Gundry <adam@well-typed.com>2015-10-16 13:58:52 +0100
committerAdam Gundry <adam@well-typed.com>2015-10-16 13:58:52 +0100
commit5a1b4f814f74ec1c48152d97523744518e212777 (patch)
tree7c2207ecacbd37f12c78dbcf9d4334827164e0fb /libraries/base/Control/Concurrent.hs
parent6757950cdd8bb0af0355539987ee78401a6a8f6b (diff)
parent808bbdf08058785ae5bc59b5b4f2b04951d4cbbf (diff)
downloadhaskell-wip/orf-reboot.tar.gz
Merge remote-tracking branch 'origin/master' into wip/orf-rebootwip/orf-reboot
Conflicts: compiler/rename/RnNames.hs compiler/typecheck/TcRnMonad.hs utils/haddock
Diffstat (limited to 'libraries/base/Control/Concurrent.hs')
-rw-r--r--libraries/base/Control/Concurrent.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/libraries/base/Control/Concurrent.hs b/libraries/base/Control/Concurrent.hs
index 35248bfba3..1786c3ded3 100644
--- a/libraries/base/Control/Concurrent.hs
+++ b/libraries/base/Control/Concurrent.hs
@@ -3,6 +3,7 @@
, MagicHash
, UnboxedTuples
, ScopedTypeVariables
+ , RankNTypes
#-}
{-# OPTIONS_GHC -fno-warn-deprecations #-}
-- kludge for the Control.Concurrent.QSem, Control.Concurrent.QSemN
@@ -73,6 +74,7 @@ module Control.Concurrent (
-- $boundthreads
rtsSupportsBoundThreads,
forkOS,
+ forkOSWithUnmask,
isCurrentThreadBound,
runInBoundThread,
runInUnboundThread,
@@ -180,7 +182,7 @@ attribute will block all other threads.
-}
--- | fork a thread and call the supplied function when the thread is about
+-- | Fork a thread and call the supplied function when the thread is about
-- to terminate, with an exception or a returned value. The function is
-- called with asynchronous exceptions masked.
--
@@ -316,6 +318,11 @@ forkOS action0
return tid
| otherwise = failNonThreaded
+-- | Like 'forkIOWithUnmask', but the child thread is a bound thread,
+-- as with 'forkOS'.
+forkOSWithUnmask :: ((forall a . IO a -> IO a) -> IO ()) -> IO ThreadId
+forkOSWithUnmask io = forkOS (io unsafeUnmask)
+
-- | Returns 'True' if the calling thread is /bound/, that is, if it is
-- safe to use foreign libraries that rely on thread-local state from the
-- calling thread.