Add failing bound thread signifiers. Closes #22.

This commit is contained in:
Michael Walker 2015-11-03 19:53:13 +00:00
parent 772aba80d0
commit aa0202a5af

View File

@ -7,10 +7,19 @@
-- monads.
module Control.Monad.Conc.Class
( MonadConc(..)
-- * Utilities
, spawn
, forkFinally
, killThread
-- * Bound Threads
-- | @MonadConc@ does not support bound threads, if you need that
-- sort of thing you will have to use regular @IO@.
, rtsSupportsBoundThreads
, isCurrentThreadBound
) where
import Control.Concurrent (forkIO)
@ -311,6 +320,14 @@ forkFinally action and_then =
killThread :: MonadConc m => ThreadId m -> m ()
killThread tid = throwTo tid ThreadKilled
-- | Provided for compatibility, always returns 'False'.
rtsSupportsBoundThreads :: Bool
rtsSupportsBoundThreads = False
-- | Provided for compatibility, always returns 'False'.
isCurrentThreadBound :: MonadConc m => m Bool
isCurrentThreadBound = return False
-------------------------------------------------------------------------------
-- Transformer instances