@@ -17,18 +17,17 @@ data Effect = Effect {
17
17
effectReads :: ! (Set TVarId ),
18
18
effectWrites :: ! (Set TVarId ),
19
19
effectForks :: ! (Set ThreadId ),
20
- effectLiftST :: ! Bool ,
21
20
effectThrows :: ! [ThreadId ],
22
21
effectWakeup :: ! [ThreadId ]
23
22
}
24
23
deriving (Eq , Show )
25
24
26
25
instance Semigroup Effect where
27
- Effect r w s b ts wu <> Effect r' w' s' b ' ts' wu' =
28
- Effect (r<> r') (w<> w') (s<> s') (b || b') ( ts++ ts') (wu++ wu')
26
+ Effect r w s ts wu <> Effect r' w' s' ts' wu' =
27
+ Effect (r<> r') (w<> w') (s<> s') (ts++ ts') (wu++ wu')
29
28
30
29
instance Monoid Effect where
31
- mempty = Effect Set. empty Set. empty Set. empty False [] []
30
+ mempty = Effect Set. empty Set. empty Set. empty [] []
32
31
33
32
-- readEffect :: SomeTVar s -> Effect
34
33
-- readEffect r = mempty{effectReads = Set.singleton $ someTvarId r }
@@ -45,9 +44,6 @@ writeEffects rs = mempty{effectWrites = Set.fromList (map someTvarId rs)}
45
44
forkEffect :: ThreadId -> Effect
46
45
forkEffect tid = mempty {effectForks = Set. singleton $ tid}
47
46
48
- liftSTEffect :: Effect
49
- liftSTEffect = mempty { effectLiftST = True }
50
-
51
47
throwToEffect :: ThreadId -> Effect
52
48
throwToEffect tid = mempty { effectThrows = [tid] }
53
49
@@ -62,9 +58,7 @@ onlyReadEffect e = e { effectReads = effectReads mempty } == mempty
62
58
63
59
racingEffects :: Effect -> Effect -> Bool
64
60
racingEffects e e' =
65
- (effectLiftST e && racesWithLiftST e')
66
- || (effectLiftST e' && racesWithLiftST e )
67
- || effectThrows e `intersectsL` effectThrows e'
61
+ effectThrows e `intersectsL` effectThrows e'
68
62
|| effectReads e `intersects` effectWrites e'
69
63
|| effectWrites e `intersects` effectReads e'
70
64
|| effectWrites e `intersects` effectWrites e'
@@ -74,8 +68,3 @@ racingEffects e e' =
74
68
75
69
intersectsL :: Eq a => [a ] -> [a ] -> Bool
76
70
intersectsL a b = not $ null $ a `List.intersect` b
77
-
78
- racesWithLiftST eff =
79
- effectLiftST eff
80
- || not (Set. null (effectReads eff) && Set. null (effectWrites eff))
81
-
0 commit comments