Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions tests/T16707.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Control.Concurrent
import Control.Concurrent.STM
import Debug.Trace

main :: IO ()
main = (`mapM_` [1..1000]) $ \_ -> do
traceEventIO "(((("

x <- newTVarIO False

forkIO $ atomically $ writeTVar x True

traceEventIO "----"

atomically $ do -- hangs in the second iteration
_ <- readTVar x
writeTVar x True `orElse` return ()

threadDelay 100000
traceEventIO "))))"
1 change: 1 addition & 0 deletions tests/all.T
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ test('stm065', normal, compile_and_run, ['-package stm'])
test('cloneTChan001', normal, compile_and_run, ['-package stm'])

test('T15136', extra_run_opts('20'), compile_and_run, ['-package stm'])
test('T16707', normal, compile_and_run, [''])