@@ -425,9 +425,11 @@ schedule thread@Thread{
425
425
tvar <- execNewTVar nextVid
426
426
(Just $ " <<timeout-state " ++ show (unTimeoutId nextTmid) ++ " >>" )
427
427
TimeoutPending
428
+ modifySTRef (tvarVClock tvar) (leastUpperBoundVClock vClock)
428
429
tvar' <- execNewTVar (succ nextVid)
429
430
(Just $ " <<timeout " ++ show (unTimeoutId nextTmid) ++ " >>" )
430
431
False
432
+ modifySTRef (tvarVClock tvar') (leastUpperBoundVClock vClock)
431
433
let expiry = d `addTime` time
432
434
t = Timeout tvar tvar' nextTmid
433
435
timers' = PSQ. insert nextTmid expiry (TimerVars tvar tvar') timers
@@ -461,7 +463,7 @@ schedule thread@Thread{
461
463
let thread' = thread { threadControl = ThreadControl k ctl }
462
464
schedule thread' simstate
463
465
464
- CancelTimeout (Timeout tvar _tvar ' tmid) k -> do
466
+ CancelTimeout (Timeout tvar tvar ' tmid) k -> do
465
467
let timers' = PSQ. delete tmid timers
466
468
written <- execAtomically' (runSTM $ writeTVar tvar TimeoutCancelled )
467
469
(wakeup, wokeby) <- threadsUnblockedByWrites written
@@ -474,6 +476,8 @@ schedule thread@Thread{
474
476
}
475
477
(unblocked,
476
478
simstate') = unblockThreads vClock wakeup simstate
479
+ modifySTRef (tvarVClock tvar) (leastUpperBoundVClock vClock)
480
+ modifySTRef (tvarVClock tvar') (leastUpperBoundVClock vClock)
477
481
trace <- deschedule Yield thread' simstate' { timers = timers' }
478
482
return $ SimTrace time tid tlbl (EventTimerCancelled tmid)
479
483
$ traceMany
0 commit comments