#5055: STM Exception "BlockedIndefinitelyOnSTM" throws to wrong thread
---------------------------------+------------------------------------------
    Reporter:  guest             |       Owner:              
        Type:  bug               |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:  7.0.3             |    Keywords:  stm         
    Testcase:                    |   Blockedby:              
          Os:  Unknown/Multiple  |    Blocking:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
 This might be two bugs.  The attached test file (tvarTest.hs) aims to use
 a separate thread catching a "BlockedIndefinitelyOnSTM" exception to
 adjust the state of another TVar (a poor mans finalizer on TVars).

 More concretely, with TVars "b" and "i" I have a thread (running "gcTVar")
 retrying on a read of "i" then alters "b" if/when the
 BlockIndefinitelyOnSTM exception is received.  My main thread waits for
 the state of "b" to change (which is should, due to "gcTVar").

 Unfortunately, compiling with GHC (6.12.3, 7.0.1, 7.0.3, threaded or not,
 optimized or not, it all behaves the same) the main thread receives the
 exception and not the thread running "gcTVar".

 The behavior is different in GHCi.  GHCi seems to operate correctly.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5055>
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