File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Expand file tree Collapse file tree 3 files changed +20
-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
1
+ // The rustc-cfg emitted by the build script are *not* public API.
2
+
3
+ use std:: env;
4
+
5
+ fn main ( ) {
6
+ println ! ( "cargo:rerun-if-changed=no_atomic.rs" ) ;
7
+
8
+ // `cfg(sanitize = "..")` is not stabilized.
9
+ let sanitize = env:: var ( "CARGO_CFG_SANITIZE" ) . unwrap_or_default ( ) ;
10
+ if sanitize. contains ( "thread" ) {
11
+ println ! ( "cargo:rustc-cfg=crossbeam_sanitize_thread" ) ;
12
+ }
13
+ }
Original file line number Diff line number Diff line change @@ -249,10 +249,16 @@ impl Global {
249
249
if local_epoch. is_pinned ( ) && local_epoch. unpinned ( ) != global_epoch {
250
250
return global_epoch;
251
251
}
252
+
253
+ if cfg ! ( crossbeam_sanitize_thread) {
254
+ local. epoch . load ( Ordering :: Acquire ) ;
255
+ }
252
256
}
253
257
}
254
258
}
255
- atomic:: fence ( Ordering :: Acquire ) ;
259
+ if !cfg ! ( crossbeam_sanitize_thread) {
260
+ atomic:: fence ( Ordering :: Acquire ) ;
261
+ }
256
262
257
263
// All pinned participants were pinned in the current global epoch.
258
264
// Now let's advance the global epoch...
You can’t perform that action at this time.
0 commit comments