stm-extras-0.1.0.2: Extra STM functions

Safe HaskellSafe
LanguageHaskell2010

Control.Concurrent.STM.TMVar.Extras

Synopsis

Documentation

forceSwapTMVar :: TMVar a -> a -> STM (Maybe a) Source #

Non-blocking swap of TMVar irreguardless if it previously contained a value or not. Returns what was in the TMVar (if exists)

waitTillEmptyTMVar :: TMVar a -> a -> STM () Source #

Block until TMVar is empty. The argument a is used to try to put into TMVar, but is taken out again in the same transaction

waitTillFullTMVar :: TMVar a -> STM () Source #

Block until TMVar is full.