mask, catch, myThreadId, throwTo

2013-04-15 Thread Felipe Almeida Lessa
Hey! I have some code that is not behaving the way I thought it should. The gist of it is sleeper = mask_ $ forkIOWithUnmask $ \restore - forever $ restore sleep `catch` throwBack throwBack (Ping tid) = myThreadId = throwTo tid . Pong throwBack (Pong tid) =

Re: mask, catch, myThreadId, throwTo

2013-04-15 Thread Bertram Felgenhauer
Felipe Almeida Lessa wrote: I have some code that is not behaving the way I thought it should. The gist of it is sleeper = mask_ $ forkIOWithUnmask $ \restore - forever $ restore sleep `catch` throwBack throwBack (Ping tid) = myThreadId = throwTo tid . Pong

Re: mask, catch, myThreadId, throwTo

2013-04-15 Thread Felipe Almeida Lessa
Thanks a lot, you're correct! The trouble is, I was misguided by the Interruptible operations note [1] which states that The following operations are guaranteed not to be interruptible: ... * everything from Control.Exception ... Well, it seems that not everything from

Re: mask, catch, myThreadId, throwTo

2013-04-15 Thread Edward Z. Yang
Sounds like those docs need to be fixed, in that case. Edward Excerpts from Felipe Almeida Lessa's message of Mon Apr 15 13:34:50 -0700 2013: Thanks a lot, you're correct! The trouble is, I was misguided by the Interruptible operations note [1] which states that The following