File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1
1
# TSAN suppressions file for crossbeam
2
2
3
- # The epoch-based GC uses fences.
4
- race:crossbeam_epoch
5
-
6
3
# Push and steal operations in crossbeam-deque may cause data races, but such
7
4
# data races are safe. If a data race happens, the value read by `steal` is
8
5
# forgotten and the steal operation is then retried.
Original file line number Diff line number Diff line change @@ -54,4 +54,10 @@ fn main() {
54
54
if !cfg. probe_rustc_version ( 1 , 61 ) {
55
55
println ! ( "cargo:rustc-cfg=crossbeam_no_const_fn_trait_bound" ) ;
56
56
}
57
+
58
+ // `cfg(sanitize = "..")` is not stabilized.
59
+ let sanitize = env:: var ( "CARGO_CFG_SANITIZE" ) . unwrap_or_default ( ) ;
60
+ if sanitize. contains ( "thread" ) {
61
+ println ! ( "cargo:rustc-cfg=crossbeam_sanitize_thread" ) ;
62
+ }
57
63
}
Original file line number Diff line number Diff line change @@ -250,10 +250,16 @@ impl Global {
250
250
if local_epoch. is_pinned ( ) && local_epoch. unpinned ( ) != global_epoch {
251
251
return global_epoch;
252
252
}
253
+
254
+ if cfg ! ( crossbeam_sanitize_thread) {
255
+ local. epoch . load ( Ordering :: Acquire ) ;
256
+ }
253
257
}
254
258
}
255
259
}
256
- atomic:: fence ( Ordering :: Acquire ) ;
260
+ if !cfg ! ( crossbeam_sanitize_thread) {
261
+ atomic:: fence ( Ordering :: Acquire ) ;
262
+ }
257
263
258
264
// All pinned participants were pinned in the current global epoch.
259
265
// Now let's advance the global epoch...
You can’t perform that action at this time.
0 commit comments