
10 Dec
2012
10 Dec
'12
9:20 a.m.
On 10/12/12 13:24, Bas van Dijk wrote:
import Control.Concurrent.STM main = do x <- atomically $ do t <- newTVar 1 writeTVar t 2 ((writeTVar t 3 >> retry) `orElse` return ()) `orElse` return () readTVar t print x
Yes, it gives the right answer now. I don't think reading or writing in the inner transaction affects the bug, since that part is aborted before we get to the outer orElse, which is where the erroneous case was triggered. Cheers, Simon