@@ -527,7 +527,7 @@ schedule thread@Thread{
527
527
let expiry = d `addTime` time
528
528
timers' = PSQ. insert nextTmid expiry (TimerThreadDelay tid nextTmid) timers
529
529
thread' = thread { threadControl = ThreadControl (Return () ) (DelayFrame nextTmid k ctl) }
530
- trace <- deschedule (Blocked BlockedOnOther ) thread'
530
+ trace <- deschedule (Blocked BlockedOnDelay ) thread'
531
531
simstate { timers = timers',
532
532
nextTmid = succ nextTmid }
533
533
return (SimPORTrace time tid tstep tlbl (EventThreadDelay nextTmid expiry) trace)
@@ -761,10 +761,10 @@ schedule thread@Thread{
761
761
let adjustTarget t =
762
762
t { threadThrowTo = (e, Labelled tid tlbl, vClock) : threadThrowTo t }
763
763
threads' = Map. adjust adjustTarget tid' threads
764
- trace <- deschedule (Blocked BlockedOnOther ) thread' simstate { threads = threads' }
764
+ trace <- deschedule (Blocked BlockedOnThrowTo ) thread' simstate { threads = threads' }
765
765
return $ SimPORTrace time tid tstep tlbl (EventThrowTo e tid')
766
766
$ SimPORTrace time tid tstep tlbl EventThrowToBlocked
767
- $ SimPORTrace time tid tstep tlbl (EventDeschedule (Blocked BlockedOnOther ))
767
+ $ SimPORTrace time tid tstep tlbl (EventDeschedule (Blocked BlockedOnThrowTo ))
768
768
$ trace
769
769
else do
770
770
-- The target thread has async exceptions unmasked, or is masked but
@@ -923,10 +923,9 @@ deschedule Sleep thread@Thread { threadId = tid , threadEffect = effect }
923
923
reschedule :: SimState s a -> ST s (SimTrace a )
924
924
925
925
-- If we are following a controlled schedule, just do that.
926
- reschedule simstate@ SimState { runqueue, threads,
927
- control= control@ (ControlFollow ((tid,tstep): _) _),
928
- curTime= time
929
- } =
926
+ reschedule simstate@ SimState { runqueue, threads,
927
+ control = control@ (ControlFollow ((tid,tstep): _) _),
928
+ curTime = time } =
930
929
fmap (SimPORTrace time tid tstep Nothing (EventReschedule control)) $
931
930
assert (Down tid `PSQ.member` runqueue) $
932
931
assert (tid `Map.member` threads) $
@@ -1048,14 +1047,15 @@ unblockThreads !onlySTM vClock wakeup simstate@SimState {runqueue, threads} =
1048
1047
case Map. lookup tid threads of
1049
1048
Just Thread { threadStatus = ThreadRunning }
1050
1049
-> [ ]
1051
- Just t@ Thread { threadStatus = ThreadBlocked BlockedOnOther }
1050
+ Just t@ Thread { threadStatus = ThreadBlocked BlockedOnSTM }
1051
+ -> [t]
1052
+ Just t@ Thread { threadStatus = ThreadBlocked _ }
1052
1053
| onlySTM
1053
1054
-> [ ]
1054
1055
| otherwise
1055
1056
-> [t]
1056
- Just t@ Thread { threadStatus = ThreadBlocked BlockedOnSTM }
1057
- -> [t]
1058
- _ -> [ ]
1057
+ Just Thread { threadStatus = ThreadDone } -> [ ]
1058
+ Nothing -> [ ]
1059
1059
]
1060
1060
1061
1061
unblockedIds :: [ThreadId ]
0 commit comments