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.
asyncThreadId :: Async m a -> ThreadId mconcurrency Control.Concurrent.Classy.Async No documentation available.
tryreadBoundedChan :: MonadConc m => BoundedChan m a -> m (Maybe a)concurrency Control.Concurrent.Classy.BoundedChan A variant of readBoundedChan which, instead of blocking when the channel is empty, immediately returns Nothing. Otherwise, tryreadBoundedChan returns Just a where a is the element read from the channel. Note that this routine can still block while waiting for read access to the channel.
acquireRead :: MonadConc m => RWLock m -> m ()concurrency Control.Concurrent.Classy.RWLock 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.
newAcquiredRead :: MonadConc m => m (RWLock m)concurrency Control.Concurrent.Classy.RWLock Create a new RWLock in the "read" state; only read can be acquired without blocking.
releaseRead :: MonadConc m => RWLock m -> m ()concurrency Control.Concurrent.Classy.RWLock 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 :: MonadConc m => RWLock m -> m Boolconcurrency Control.Concurrent.Classy.RWLock Try to acquire the read lock; non blocking. Like acquireRead, but doesn't block. Returns True if the resulting state is "read", False otherwise.
tryWithRead :: MonadConc m => RWLock m -> m a -> m (Maybe a)concurrency Control.Concurrent.Classy.RWLock A non-blocking withRead. First tries to acquire the lock. If that fails, Nothing is returned. If it succeeds, the computation is performed. When the computation terminates, whether normally or by raising an exception, the lock is released and Just the result of the computation is returned.
waitRead :: MonadConc m => RWLock m -> m ()concurrency Control.Concurrent.Classy.RWLock - When the state is "write", waitRead blocks until a call to releaseWrite in another thread changes the state to "free".
- When the state is "free" or "read" waitRead returns immediately.
waitRead l = mask_ $ acquireRead l >> releaseRead l
withRead :: MonadConc m => RWLock m -> m a -> m aconcurrency Control.Concurrent.Classy.RWLock A convenience function wich first acquires read access and then performs the computation. When the computation terminates, whether normally or by raising an exception, the read lock is released.
tryReadTBQueue :: MonadSTM stm => TBQueue stm a -> stm (Maybe a)concurrency Control.Concurrent.Classy.STM.TBQueue A version of readTBQueue which does not retry. Instead it returns Nothing if no value is available.