@@ -1466,30 +1466,30 @@ updateRaces newStep@Step{ stepThreadId = tid, stepEffect = newEffect }
1466
1466
1467
1467
-- a new step cannot race with any threads that it just woke up
1468
1468
new :: [StepInfo ]
1469
- new | isNotRacyThreadId tid = [] -- non-racy threads do not race
1470
- | Set. null newConcurrent = [] -- cannot race with anything
1471
- | justBlocking = [] -- no need to defer a blocking transaction
1472
- | otherwise =
1473
- [StepInfo { stepInfoStep = newStep,
1474
- stepInfoControl = control,
1475
- stepInfoConcurrent = newConcurrent,
1476
- stepInfoNonDep = [] ,
1477
- stepInfoRaces = []
1478
- }]
1469
+ ! new | isNotRacyThreadId tid = [] -- non-racy threads do not race
1470
+ | Set. null newConcurrent = [] -- cannot race with anything
1471
+ | justBlocking = [] -- no need to defer a blocking transaction
1472
+ | otherwise =
1473
+ [StepInfo { stepInfoStep = newStep,
1474
+ stepInfoControl = control,
1475
+ stepInfoConcurrent = newConcurrent,
1476
+ stepInfoNonDep = [] ,
1477
+ stepInfoRaces = []
1478
+ }]
1479
1479
where
1480
1480
newConcurrent :: Set ThreadId
1481
1481
newConcurrent = foldr Set. delete newConcurrent0 (effectWakeup newEffect)
1482
1482
1483
1483
activeRaces' :: [StepInfo ]
1484
- activeRaces' =
1484
+ ! activeRaces' =
1485
1485
[ -- if this step depends on the previous step, or is not concurrent,
1486
1486
-- then any threads that it wakes up become non-concurrent also.
1487
- let lessConcurrent = foldr Set. delete concurrent (effectWakeup newEffect) in
1487
+ let ! lessConcurrent = foldr Set. delete concurrent (effectWakeup newEffect) in
1488
1488
if tid `elem` concurrent then
1489
1489
let theseStepsRace = isRacyThreadId tid && racingSteps step newStep
1490
1490
happensBefore = step `happensBeforeStep` newStep
1491
- nondep' | happensBefore = nondep
1492
- | otherwise = newStep : nondep
1491
+ ! nondep' | happensBefore = nondep
1492
+ | otherwise = newStep : nondep
1493
1493
-- We will only record the first race with each thread---reversing
1494
1494
-- the first race makes the next race detectable. Thus we remove a
1495
1495
-- thread from the concurrent set after the first race.
@@ -1499,10 +1499,10 @@ updateRaces newStep@Step{ stepThreadId = tid, stepEffect = newEffect }
1499
1499
-- Here we record discovered races.
1500
1500
-- We only record a new race if we are following the default schedule,
1501
1501
-- to avoid finding the same race in different parts of the search space.
1502
- stepRaces' | (control == ControlDefault ||
1503
- control == ControlFollow [] [] ) &&
1504
- theseStepsRace = newStep : stepRaces
1505
- | otherwise = stepRaces
1502
+ ! stepRaces' | (control == ControlDefault ||
1503
+ control == ControlFollow [] [] ) &&
1504
+ theseStepsRace = newStep : stepRaces
1505
+ | otherwise = stepRaces
1506
1506
1507
1507
in stepInfo { stepInfoConcurrent = effectForks newEffect
1508
1508
`Set.union` concurrent',
@@ -1512,10 +1512,10 @@ updateRaces newStep@Step{ stepThreadId = tid, stepEffect = newEffect }
1512
1512
1513
1513
else stepInfo { stepInfoConcurrent = lessConcurrent }
1514
1514
1515
- | stepInfo@ StepInfo { stepInfoStep = step,
1516
- stepInfoConcurrent = concurrent,
1517
- stepInfoNonDep = nondep,
1518
- stepInfoRaces = stepRaces
1515
+ | ! stepInfo@ StepInfo { stepInfoStep = step,
1516
+ stepInfoConcurrent = concurrent,
1517
+ stepInfoNonDep = nondep,
1518
+ stepInfoRaces = stepRaces
1519
1519
}
1520
1520
<- activeRaces ]
1521
1521
in normalizeRaces $ races { activeRaces = new ++ activeRaces' }
@@ -1531,10 +1531,10 @@ threadTerminatesRaces tid races@Races{ activeRaces } =
1531
1531
1532
1532
normalizeRaces :: Races -> Races
1533
1533
normalizeRaces Races { activeRaces, completeRaces } =
1534
- let activeRaces' = filter (not . null . stepInfoConcurrent) activeRaces
1535
- completeRaces' = filter (not . null . stepInfoRaces)
1536
- (filter (null . stepInfoConcurrent) activeRaces)
1537
- ++ completeRaces
1534
+ let ! activeRaces' = filter (not . null . stepInfoConcurrent) activeRaces
1535
+ ! completeRaces' = filter (not . null . stepInfoRaces)
1536
+ (filter (null . stepInfoConcurrent) activeRaces)
1537
+ ++ completeRaces
1538
1538
in Races { activeRaces = activeRaces', completeRaces = completeRaces' }
1539
1539
1540
1540
-- We assume that steps do not race with later steps after a quiescent
0 commit comments