Safe Haskell | None |
---|---|
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 :: Type -> Type) where
- type ThreadId (m :: Type -> Type)
- myThreadId :: m (ThreadId m)
- labelThread :: ThreadId m -> String -> m ()
- threadLabel :: ThreadId m -> m (Maybe String)
- labelThisThread :: MonadThread m => String -> m ()
- class MonadThread m => MonadFork (m :: Type -> Type) 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 :: Type -> Type) where Source #
myThreadId :: m (ThreadId m) Source #
labelThread :: ThreadId m -> String -> m () Source #
threadLabel :: ThreadId m -> m (Maybe String) Source #
Requires ghc-9.6.1 or newer.
Since: 1.8.0.0
Instances
MonadThread IO Source # | |||||
MonadThread m => MonadThread (ReaderT r m) Source # | |||||
Defined in Control.Monad.Class.MonadFork
|
labelThisThread :: MonadThread m => String -> m () Source #
Apply the label to the current thread
class MonadThread m => MonadFork (m :: Type -> Type) 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 #