#2560: killThread and getChanContents appear to interact strangely
---------------------------------+------------------------------------------
    Reporter:  batterseapower    |        Owner:                  
        Type:  bug               |       Status:  new             
    Priority:  normal            |    Milestone:  6.10.2          
   Component:  Runtime System    |      Version:  6.9             
    Severity:  normal            |   Resolution:                  
    Keywords:                    |   Difficulty:  Unknown         
    Testcase:                    |           Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
---------------------------------+------------------------------------------
Comment (by igloo):

 OK, I think the problem is that
 {{{
 readChan = modifyMVar ...
 }}}
 and
 {{{
 modifyMVar :: MVar a -> (a -> IO (a,b)) -> IO b
 modifyMVar m io =
   block $ do
     a      <- takeMVar m
     (a',b) <- unblock (io a) `onException` putMVar m a
     putMVar m a'
     return b
 }}}
 so although you are calling `readChan` with exceptions blocked, they are
 being unblocked by the library.

 I'm not sure what the best solution is.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2560#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to