@@ -568,10 +568,11 @@ schedule thread@Thread{
568568 CancelTimeout (Timeout tvar tmid) k -> do
569569 let timers' = PSQ. delete tmid timers
570570 written <- execAtomically' (runSTM $ writeTVar tvar TimeoutCancelled )
571+ written' <- mapM someTVarToLabelled written
571572 (wakeup, wokeby) <- threadsUnblockedByWrites written
572573 mapM_ (\ (SomeTVar var) -> unblockAllThreadsFromTVar var) written
573574 let effect' = effect
574- <> writeEffects written
575+ <> writeEffects written'
575576 <> wakeupEffects wakeup
576577 thread' = thread { threadControl = ThreadControl k ctl
577578 , threadEffect = effect'
@@ -636,10 +637,12 @@ schedule thread@Thread{
636637 (wakeup, wokeby) <- threadsUnblockedByWrites written
637638 mapM_ (\ (SomeTVar tvar) -> unblockAllThreadsFromTVar tvar) written
638639 vClockRead <- leastUpperBoundTVarVClocks read
640+ read' <- mapM someTVarToLabelled read
641+ written' <- mapM someTVarToLabelled written
639642 let vClock' = vClock `leastUpperBoundVClock` vClockRead
640643 effect' = effect
641- <> readEffects read
642- <> writeEffects written
644+ <> readEffects read'
645+ <> writeEffects written'
643646 <> wakeupEffects unblocked
644647 thread' = thread { threadControl = ThreadControl (k x) ctl,
645648 threadVClock = vClock',
@@ -648,12 +651,12 @@ schedule thread@Thread{
648651 simstate') = unblockThreads True vClock' wakeup simstate
649652 sequence_ [ modifySTRef (tvarVClock r) (leastUpperBoundVClock vClock')
650653 | SomeTVar r <- created ++ written ]
651- written' <- traverse (\ (SomeTVar tvar) -> labelledTVarId tvar) written
654+ written'' <- traverse (\ (SomeTVar tvar) -> labelledTVarId tvar) written
652655 created' <- traverse (\ (SomeTVar tvar) -> labelledTVarId tvar) created
653656 -- We deschedule a thread after a transaction... another may have woken up.
654657 ! trace <- deschedule Yield thread' simstate' { nextVid = nextVid' }
655658 return $
656- SimPORTrace time tid tstep tlbl (EventTxCommitted written' created' (Just effect')) $
659+ SimPORTrace time tid tstep tlbl (EventTxCommitted written'' created' (Just effect')) $
657660 traceMany
658661 [ (time, tid', (- 1 ), tlbl', EventTxWakeup vids')
659662 | tid' <- unblocked
@@ -674,7 +677,8 @@ schedule thread@Thread{
674677 StmTxAborted read e -> do
675678 -- schedule this thread to immediately raise the exception
676679 vClockRead <- leastUpperBoundTVarVClocks read
677- let effect' = effect <> readEffects read
680+ read' <- mapM someTVarToLabelled read
681+ let effect' = effect <> readEffects read'
678682 thread' = thread { threadControl = ThreadControl (Throw e) ctl,
679683 threadVClock = vClock `leastUpperBoundVClock` vClockRead,
680684 threadEffect = effect' }
@@ -686,7 +690,8 @@ schedule thread@Thread{
686690 mapM_ (\ (SomeTVar tvar) -> blockThreadOnTVar tid tvar) read
687691 vids <- traverse (\ (SomeTVar tvar) -> labelledTVarId tvar) read
688692 vClockRead <- leastUpperBoundTVarVClocks read
689- let effect' = effect <> readEffects read
693+ read' <- mapM someTVarToLabelled read
694+ let effect' = effect <> readEffects read'
690695 thread' = thread { threadVClock = vClock `leastUpperBoundVClock` vClockRead,
691696 threadEffect = effect' }
692697 ! trace <- deschedule (Blocked BlockedOnSTM ) thread' simstate
0 commit comments