Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
A generalisation of
Control.Concurrent
API to both IO
and IOSim.
Synopsis
- class (Monad m, Eq (ThreadId m), Ord (ThreadId m), Show (ThreadId m)) => MonadThread m where
- type ThreadId m :: Type
- myThreadId :: m (ThreadId m)
- labelThread :: ThreadId m -> String -> m ()
- labelThisThread :: MonadThread m => String -> m ()
- class MonadThread m => MonadFork m where
- forkIO :: m () -> m (ThreadId m)
- forkOn :: Int -> m () -> m (ThreadId m)
- forkIOWithUnmask :: ((forall a. m a -> m a) -> m ()) -> m (ThreadId m)
- forkFinally :: m a -> (Either SomeException a -> m ()) -> m (ThreadId m)
- throwTo :: Exception e => ThreadId m -> e -> m ()
- killThread :: ThreadId m -> m ()
- yield :: m ()
Documentation
class (Monad m, Eq (ThreadId m), Ord (ThreadId m), Show (ThreadId m)) => MonadThread m where Source #
myThreadId :: m (ThreadId m) Source #
labelThread :: ThreadId m -> String -> m () Source #
Instances
MonadThread IO Source # | |
MonadThread m => MonadThread (ReaderT r m) Source # | |
labelThisThread :: MonadThread m => String -> m () Source #
Apply the label to the current thread
class MonadThread m => MonadFork m where Source #
forkIO :: m () -> m (ThreadId m) Source #
forkOn :: Int -> m () -> m (ThreadId m) Source #
forkIOWithUnmask :: ((forall a. m a -> m a) -> m ()) -> m (ThreadId m) Source #
forkFinally :: m a -> (Either SomeException a -> m ()) -> m (ThreadId m) Source #
throwTo :: Exception e => ThreadId m -> e -> m () Source #
killThread :: ThreadId m -> m () Source #