Hoogle Search
Within LTS Haskell 24.52 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
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.
threadDelay :: MonadConc m => Int -> m ()concurrency Control.Monad.Conc.Class Yields the current thread, and optionally suspends the current thread for a given number of microseconds. If suspended, there is no guarantee that the thread will be rescheduled promptly when the delay has expired, but the thread will never continue to run earlier than specified.
threadDelay _ = yield
tryReadMVar :: MonadConc m => MVar m a -> m (Maybe a)concurrency Control.Monad.Conc.Class Attempt to read a value from a MVar non-blockingly, returning a Just if there is something there, otherwise returning Nothing. As with readMVar, this does not "remove" the value.
acquireRead :: RWLock -> IO ()concurrent-extra Control.Concurrent.ReadWriteLock Acquire the read lock. Blocks if another thread has acquired write access. If acquireRead terminates without throwing an exception the state of the RWLock will be "read". Implementation note: Throws an exception when more than (maxBound :: Int) simultaneous threads acquire the read lock. But that is unlikely.
-
concurrent-extra Control.Concurrent.ReadWriteLock Create a new RWLock in the "read" state; only read can be acquired without blocking.
releaseRead :: RWLock -> IO ()concurrent-extra Control.Concurrent.ReadWriteLock Release the read lock. If the calling thread was the last one to relinquish read access the state will revert to "free". It is an error to release read access to an RWLock which is not in the "read" state.
tryAcquireRead :: RWLock -> IO Boolconcurrent-extra Control.Concurrent.ReadWriteLock Try to acquire the read lock; non blocking. Like acquireRead, but doesn't block. Returns True if the resulting state is "read", False otherwise.