Commit dec5cd40 authored by joeyadams's avatar joeyadams Committed by Austin Seipp
Browse files

base: Add forkOSWithUnmask

Fixes #8010, according to the specified libraries proposal. [1]

Also, some minor wordsmithing.

  [1] http://thread.gmane.org/gmane.comp.lang.haskell.libraries/22709

Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent e5bfd704
......@@ -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.
......
......@@ -67,7 +67,11 @@
unlifted types (#10868)
* Keep `shift{L,R}` on `Integer` with negative shift-arguments from
segfaulting (#10571)
segfaulting (#10571)
* Add `forkOSWithUnmask` to `Control.Concurrent`, which is like
`forkIOWithUnmask`, but the child is run in a bound thread.
## 4.8.1.0 *Jul 2015*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment