Skip to content

Commit 09db4ce

Browse files
committed
io-sim-por: pass written tvars before read
This makes the usage of `StmTxCommited` the same in both `io-sim` and `io-sim-por`.
1 parent b2e291d commit 09db4ce

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

io-sim/src/Control/Monad/IOSimPOR/Internal.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ schedule thread@Thread{
510510

511511
Atomically a k -> execAtomically time tid tlbl nextVid (runSTM a) $ \res ->
512512
case res of
513-
StmTxCommitted x read written nextVid' -> do
513+
StmTxCommitted x written read nextVid' -> do
514514
(wakeup, wokeby) <- threadsUnblockedByWrites written
515515
mapM_ (\(SomeTVar tvar) -> unblockAllThreadsFromTVar tvar) written
516516
vClockRead <- leastUpperBoundTVarVClocks read
@@ -1008,8 +1008,9 @@ execAtomically time tid tlbl nextVid0 action0 k0 =
10081008
) written
10091009

10101010
-- Return the vars written, so readers can be unblocked
1011-
k0 $ StmTxCommitted x (Map.elems read)
1012-
(reverse writtenSeq) nextVid
1011+
k0 $ StmTxCommitted x (reverse writtenSeq)
1012+
(Map.elems read)
1013+
nextVid
10131014

10141015
OrElseLeftFrame _b k writtenOuter writtenOuterSeq ctl' -> do
10151016
-- Commit the TVars written in this sub-transaction that are also

0 commit comments

Comments
 (0)