[GHC] #9379: Blocked STM transaction is not interruptible
GHC
ghc-devs at haskell.org
Tue Jul 29 22:42:50 UTC 2014
#9379: Blocked STM transaction is not interruptible
-------------------------------------+-------------------------------------
Reporter: Feuerbach | Owner: simonmar
Type: bug | Status: new
Priority: normal | Milestone:
Component: Runtime System | Version: 7.8.3
Keywords: | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Unknown | Type of failure:
Blocked By: | None/Unknown
Related Tickets: | Test Case:
| Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
{{{#!hs
import Control.Exception
import Control.Concurrent
import Control.Concurrent.STM
import Foreign.StablePtr
main :: IO ()
main = do
tv <- atomically $ newTVar True
_ <- newStablePtr tv
t <- mask_ $ forkIO (blockSTM tv)
killThread t
blockSTM :: TVar Bool -> IO ()
blockSTM tv = do
atomically $ do
v <- readTVar tv
check $ not v
}}}
This code blocks forever. As I understand it, since the transaction
blocks, it should be interruptible even despite the mask, and so
killThread must succeed here, and the program should finish promptly.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9379>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list