| Prev | Next |
atomic (getR r1 3 ‘orElse‘ getR r2 7)
nonBlockGetR :: Resource -> Int -> STM Bool
nonBlockGetR r i = do { getR r i ; return True }
‘orElse‘ return False
blockGetR r i =
do { s <- nonBlockGetR r i;
if s then return () else retry }
| 28 |