File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Expand file tree Collapse file tree 3 files changed +22
-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=build.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 @@ -248,10 +248,18 @@ impl Global {
248
248
if local_epoch. is_pinned ( ) && local_epoch. unpinned ( ) != global_epoch {
249
249
return global_epoch;
250
250
}
251
+
252
+ // TODO: This is stronger than the actual one because the fence is only emitted
253
+ // if the loop is not early exited.
254
+ if cfg ! ( crossbeam_sanitize_thread) {
255
+ local. epoch . load ( Ordering :: Acquire ) ;
256
+ }
251
257
}
252
258
}
253
259
}
254
- atomic:: fence ( Ordering :: Acquire ) ;
260
+ if !cfg ! ( crossbeam_sanitize_thread) {
261
+ atomic:: fence ( Ordering :: Acquire ) ;
262
+ }
255
263
256
264
// All pinned participants were pinned in the current global epoch.
257
265
// Now let's advance the global epoch...
You can’t perform that action at this time.
0 commit comments