@@ -455,11 +455,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
455
455
fn allow_data_races_ref < R > ( & self , op : impl FnOnce ( & MiriEvalContext < ' mir , ' tcx > ) -> R ) -> R {
456
456
let this = self . eval_context_ref ( ) ;
457
457
if let Some ( data_race) = & this. machine . data_race {
458
- data_race. ongoing_atomic_access . set ( true ) ;
458
+ data_race. ongoing_action_data_race_free . set ( true ) ;
459
459
}
460
460
let result = op ( this) ;
461
461
if let Some ( data_race) = & this. machine . data_race {
462
- data_race. ongoing_atomic_access . set ( false ) ;
462
+ data_race. ongoing_action_data_race_free . set ( false ) ;
463
463
}
464
464
result
465
465
}
@@ -474,11 +474,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
474
474
) -> R {
475
475
let this = self . eval_context_mut ( ) ;
476
476
if let Some ( data_race) = & this. machine . data_race {
477
- data_race. ongoing_atomic_access . set ( true ) ;
477
+ data_race. ongoing_action_data_race_free . set ( true ) ;
478
478
}
479
479
let result = op ( this) ;
480
480
if let Some ( data_race) = & this. machine . data_race {
481
- data_race. ongoing_atomic_access . set ( false ) ;
481
+ data_race. ongoing_action_data_race_free . set ( false ) ;
482
482
}
483
483
result
484
484
}
@@ -1151,8 +1151,9 @@ pub struct GlobalState {
1151
1151
multi_threaded : Cell < bool > ,
1152
1152
1153
1153
/// A flag to mark we are currently performing
1154
- /// an atomic access to supress data race detection
1155
- ongoing_atomic_access : Cell < bool > ,
1154
+ /// a data race free action (such as atomic access)
1155
+ /// to supress the race detector
1156
+ ongoing_action_data_race_free : Cell < bool > ,
1156
1157
1157
1158
/// Mapping of a vector index to a known set of thread
1158
1159
/// clocks, this is not directly mapping from a thread id
@@ -1205,7 +1206,7 @@ impl GlobalState {
1205
1206
pub fn new ( ) -> Self {
1206
1207
let mut global_state = GlobalState {
1207
1208
multi_threaded : Cell :: new ( false ) ,
1208
- ongoing_atomic_access : Cell :: new ( false ) ,
1209
+ ongoing_action_data_race_free : Cell :: new ( false ) ,
1209
1210
vector_clocks : RefCell :: new ( IndexVec :: new ( ) ) ,
1210
1211
vector_info : RefCell :: new ( IndexVec :: new ( ) ) ,
1211
1212
thread_info : RefCell :: new ( IndexVec :: new ( ) ) ,
@@ -1232,14 +1233,14 @@ impl GlobalState {
1232
1233
}
1233
1234
1234
1235
// We perform data race detection when there are more than 1 active thread
1235
- // and we are not currently in the middle of an atomic acces where data race
1236
- // is impossible
1236
+ // and we have not temporarily disabled race detection to perform something
1237
+ // data race free
1237
1238
fn race_detecting ( & self ) -> bool {
1238
- self . multi_threaded . get ( ) && !self . ongoing_atomic_access . get ( )
1239
+ self . multi_threaded . get ( ) && !self . ongoing_action_data_race_free . get ( )
1239
1240
}
1240
1241
1241
- pub fn ongoing_atomic_access ( & self ) -> bool {
1242
- self . ongoing_atomic_access . get ( )
1242
+ pub fn ongoing_action_data_race_free ( & self ) -> bool {
1243
+ self . ongoing_action_data_race_free . get ( )
1243
1244
}
1244
1245
1245
1246
// Try to find vector index values that can potentially be re-used
0 commit comments