readTMVar

readTMVar :: TMVar a -> STM a
stm Control.Concurrent.STM.TMVar
This is a combination of takeTMVar and putTMVar; ie. it takes the value from the TMVar, puts it back, and also returns it.
tryReadTMVar :: TMVar a -> STM (Maybe a)
stm Control.Concurrent.STM.TMVar
A version of readTMVar which does not retry. Instead it returns Nothing if no value is available.