@@ -1501,23 +1501,27 @@ controlFollows stepId (ControlFollow (stepId':_) _) = stepId == stepId'
1501
1501
controlFollows stepId (ControlAwait (smod: _)) = stepId /= scheduleModTarget smod
1502
1502
controlFollows _ (ControlAwait [] ) = error " Impossible: controlFollows _ (ControlAwait [])"
1503
1503
1504
- advanceControl :: ( ThreadId , Int ) -> ScheduleControl -> ScheduleControl
1505
- advanceControl (tid,step) (ControlFollow ((tid',step'): sids) tgts)
1504
+ advanceControl :: StepId -> ScheduleControl -> ScheduleControl
1505
+ advanceControl (tid,step) control @ (ControlFollow ((tid',step'): sids' ) tgts)
1506
1506
| tid /= tid' =
1507
1507
-- we are switching threads to follow the schedule
1508
- -- Debug.trace ("Switching threads from "++show (tid,step)++" to "++show (tid',step')++"\n") $
1509
- ControlFollow ((tid',step') : sids) tgts
1508
+ -- Debug.trace ("Switching threads from "++show (tid,step)++" to "++show (tid',step')++"\n") $
1509
+ control
1510
1510
| step == step' =
1511
- ControlFollow sids tgts
1511
+ ControlFollow sids' tgts
1512
1512
| otherwise =
1513
- error $ " advanceControl " ++ show (tid,step)++ " cannot follow step " ++ show step'++ " \n "
1513
+ error $ concat
1514
+ [ " advanceControl " , show (tid,step)
1515
+ , " cannot follow step " , show step'
1516
+ , " \n "
1517
+ ]
1514
1518
advanceControl stepId (ControlFollow [] [] ) =
1515
1519
ControlDefault
1516
1520
advanceControl stepId (ControlFollow [] tgts) =
1517
1521
ControlAwait tgts
1518
- advanceControl stepId c =
1519
- assert (not $ controlTargets stepId c ) $
1520
- c
1522
+ advanceControl stepId control =
1523
+ assert (not $ controlTargets stepId control ) $
1524
+ control
1521
1525
1522
1526
followControl :: ScheduleControl -> ScheduleControl
1523
1527
followControl (ControlAwait (ScheduleMod { scheduleModInsertion } : mods)) =
0 commit comments