Hoogle Search
Within LTS Haskell 24.68 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
tryReadTChan :: MonadSTM stm => TChan stm a -> stm (Maybe a)concurrency Control.Concurrent.Classy.STM.TChan A version of readTChan which does not retry. Instead it returns Nothing if no value is available.
tryReadTMVar :: MonadSTM stm => TMVar stm a -> stm (Maybe a)concurrency Control.Concurrent.Classy.STM.TMVar Try to read from a TMVar without emptying, returning Nothing if it is empty.
tryReadTQueue :: MonadSTM stm => TQueue stm a -> stm (Maybe a)concurrency Control.Concurrent.Classy.STM.TQueue A version of readTQueue which does not retry. Instead it returns Nothing if no value is available.
isCurrentThreadBound :: MonadConc m => m Boolconcurrency Control.Monad.Conc.Class 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. This will always be false if your program is not compiled with the threaded runtime.
killThread :: MonadConc m => ThreadId m -> m ()concurrency Control.Monad.Conc.Class Raise the ThreadKilled exception in the target thread. Note that if the thread is prepared to catch this exception, it won't actually kill it.
myThreadId :: MonadConc m => m (ThreadId m)concurrency Control.Monad.Conc.Class Get the ThreadId of the current thread.
rtsSupportsBoundThreads :: Boolconcurrency Control.Monad.Conc.Class Deprecated: Use supportsBoundThreads instead
runInBoundThread :: MonadConc m => m a -> m aconcurrency Control.Monad.Conc.Class Run the computation passed as the first argument. If the calling thread is not bound, a bound thread is created temporarily. runInBoundThread doesn't finish until the inner computation finishes. You can wrap a series of foreign function calls that rely on thread-local state with runInBoundThread so that you can use them without knowing whether the current thread is bound.
runInUnboundThread :: MonadConc m => m a -> m aconcurrency Control.Monad.Conc.Class Run the computation passed as the first argument. If the calling thread is bound, an unbound thread is created temporarily using fork. runInBoundThread doesn't finish until the inner computation finishes. Use this function only in the rare case that you have actually observed a performance loss due to the use of bound threads. A program that doesn't need its main thread to be bound and makes heavy use of concurrency (e.g. a web server), might want to wrap its main action in runInUnboundThread. Note that exceptions which are thrown to the current thread are thrown in turn to the thread that is executing the given computation. This ensures there's always a way of killing the forked thread.
supportsBoundThreads :: MonadConc m => m Boolconcurrency Control.Monad.Conc.Class Returns True if bound threads can be forked. If False, isCurrentThreadBound will always return False and both forkOS and runInBoundThread will fail.