Ticket #8010: 0001-Add-forkOSWithUnmask.patch

File 0001-Add-forkOSWithUnmask.patch, 1.8 KB (added by joeyadams, 2 years ago)

Add forkOSWithUnmask

  • Control/Concurrent.hs

    From b491b58f67851982d839d561ed6c9f124cec01ec Mon Sep 17 00:00:00 2001
    From: Joey Adams <[email protected]>
    Date: Fri, 21 Jun 2013 23:19:34 -0400
    Subject: [PATCH] Add forkOSWithUnmask
    
    Also, capitalize first word in doc for 'forkFinally'.
    ---
     Control/Concurrent.hs | 9 ++++++++-
     1 file changed, 8 insertions(+), 1 deletion(-)
    
    diff --git a/Control/Concurrent.hs b/Control/Concurrent.hs
    index 2c0f987..95ca49c 100644
    a b  
    44           , MagicHash 
    55           , UnboxedTuples 
    66           , ScopedTypeVariables 
     7           , RankNTypes 
    78  #-} 
    89{-# OPTIONS_GHC -fno-warn-unused-imports #-} 
    910{-# OPTIONS_GHC -fno-warn-deprecations #-} 
    module Control.Concurrent ( 
    8283        -- $boundthreads 
    8384        rtsSupportsBoundThreads, 
    8485        forkOS, 
     86        forkOSWithUnmask, 
    8587        isCurrentThreadBound, 
    8688        runInBoundThread, 
    8789        runInUnboundThread, 
    Using Hugs, all I\/O operations and foreign calls will block all other 
    201203Haskell threads. 
    202204-} 
    203205 
    204 -- | fork a thread and call the supplied function when the thread is about 
     206-- | Fork a thread and call the supplied function when the thread is about 
    205207-- to terminate, with an exception or a returned value.  The function is 
    206208-- called with asynchronous exceptions masked. 
    207209-- 
    forkOS action0 
    337339        return tid 
    338340    | otherwise = failNonThreaded 
    339341 
     342-- | Like 'forkIOWithUnmask', but the child thread is a bound thread, 
     343-- as with 'forkOS'. 
     344forkOSWithUnmask :: ((forall a . IO a -> IO a) -> IO ()) -> IO ThreadId 
     345forkOSWithUnmask io = forkOS (io unsafeUnmask) 
     346 
    340347-- | Returns 'True' if the calling thread is /bound/, that is, if it is 
    341348-- safe to use foreign libraries that rely on thread-local state from the 
    342349-- calling thread.