Ticket #8232: stm.patch

File stm.patch, 792 bytes (added by merijn, 2 years ago)

stm package patch.

  • Control/Concurrent/STM/TBQueue.hs

    diff -r c51d98d5f296 Control/Concurrent/STM/TBQueue.hs
    a b  
    3838        writeTBQueue,
    3939        unGetTBQueue,
    4040        isEmptyTBQueue,
     41        isFullTBQueue,
    4142  ) where
    4243
    4344import Data.Typeable
     
    177178             case ys of
    178179               [] -> return True
    179180               _  -> return False
     181
     182-- |Returns 'True' if the supplied 'TBQueue' is full.
     183isFullTBQueue :: TBQueue a -> STM Bool
     184isFullTBQueue (TBQueue rsize _read wsize _write) = do
     185  w <- readTVar wsize
     186  if (w > 0)
     187     then return False
     188     else do
     189         r <- readTVar rsize
     190         if (r > 0)
     191            then return False
     192            else return True