File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
io-sim/src/Control/Monad/IOSimPOR Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1745,7 +1745,7 @@ updateRaces thread@Thread { threadId = tid }
1745
1745
}
1746
1746
where
1747
1747
concurrent :: Set ThreadId
1748
- concurrent = foldr Set. delete concurrent0 ( effectWakeup newEffect)
1748
+ concurrent = concurrent0 Set. \\ effectWakeup newEffect
1749
1749
1750
1750
isBlocking :: Bool
1751
1751
isBlocking = isThreadBlocked thread && onlyReadEffect newEffect
@@ -1758,7 +1758,7 @@ updateRaces thread@Thread { threadId = tid }
1758
1758
stepInfoRaces } =
1759
1759
-- if this step depends on the previous step, or is not concurrent,
1760
1760
-- then any threads that it wakes up become non-concurrent also.
1761
- let ! lessConcurrent = foldr Set. delete concurrent ( effectWakeup newEffect) in
1761
+ let ! lessConcurrent = concurrent Set. \\ effectWakeup newEffect in
1762
1762
1763
1763
if tid `notElem` concurrent
1764
1764
then stepInfo { stepInfoConcurrent = lessConcurrent }
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ data Effect = Effect {
40
40
effectWrites :: ! (Set TVarId ),
41
41
effectForks :: ! (Set ThreadId ),
42
42
effectThrows :: ! [ThreadId ],
43
- effectWakeup :: ! [ ThreadId ]
43
+ effectWakeup :: ! ( Set ThreadId )
44
44
}
45
45
deriving Eq
46
46
@@ -57,10 +57,10 @@ instance Show Effect where
57
57
58
58
instance Semigroup Effect where
59
59
Effect r w s ts wu <> Effect r' w' s' ts' wu' =
60
- Effect (r <> r') (w <> w') (s <> s') (ts ++ ts') (wu++ wu')
60
+ Effect (r <> r') (w <> w') (s <> s') (ts ++ ts') (wu <> wu')
61
61
62
62
instance Monoid Effect where
63
- mempty = Effect Set. empty Set. empty Set. empty [] []
63
+ mempty = Effect Set. empty Set. empty Set. empty [] Set. empty
64
64
65
65
--
66
66
-- Effect smart constructors
@@ -85,7 +85,7 @@ throwToEffect :: ThreadId -> Effect
85
85
throwToEffect tid = mempty { effectThrows = [tid] }
86
86
87
87
wakeupEffects :: [ThreadId ] -> Effect
88
- wakeupEffects tids = mempty {effectWakeup = tids}
88
+ wakeupEffects tids = mempty {effectWakeup = Set. fromList tids}
89
89
90
90
--
91
91
-- Utils
You can’t perform that action at this time.
0 commit comments