Add newlines at end of file + use replace.
add dangling thread variant of one of the benchmarks
This commit is contained in:
parent
2e75de5ac9
commit
fe2e857cc3
7
bench-cargo-miri/mse_and_dangling_thread/Cargo.toml
Normal file
7
bench-cargo-miri/mse_and_dangling_thread/Cargo.toml
Normal file
@ -0,0 +1,7 @@
|
||||
[package]
|
||||
name = "mse"
|
||||
version = "0.1.0"
|
||||
authors = ["Ralf Jung <post@ralfj.de>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
30
bench-cargo-miri/mse_and_dangling_thread/src/main.rs
Normal file
30
bench-cargo-miri/mse_and_dangling_thread/src/main.rs
Normal file
File diff suppressed because one or more lines are too long
@ -65,12 +65,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
fn read_immediate_racy(&self, op: MPlaceTy<'tcx, Tag>) -> InterpResult<'tcx, ImmTy<'tcx, Tag>> {
|
||||
let this = self.eval_context_ref();
|
||||
let data_race = &*this.memory.extra.data_race;
|
||||
let old = data_race.multi_threaded.get();
|
||||
|
||||
data_race.multi_threaded.set(false);
|
||||
let old = data_race.multi_threaded.replace(false);
|
||||
let res = this.read_immediate(op.into());
|
||||
|
||||
data_race.multi_threaded.set(old);
|
||||
|
||||
res
|
||||
}
|
||||
|
||||
@ -80,9 +79,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
) -> InterpResult<'tcx> {
|
||||
let this = self.eval_context_mut();
|
||||
let data_race = &*this.memory.extra.data_race;
|
||||
let old = data_race.multi_threaded.get();
|
||||
let old = data_race.multi_threaded.replace(false);
|
||||
|
||||
data_race.multi_threaded.set(false);
|
||||
let imm = this.write_immediate(src, dest.into());
|
||||
|
||||
let data_race = &*this.memory.extra.data_race;
|
||||
@ -1404,4 +1402,4 @@ mod tests {
|
||||
"Invalid alt (>=):\n l: {:?}\n r: {:?}",l,r
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,4 +24,4 @@ pub fn main() {
|
||||
j1.join().unwrap();
|
||||
j2.join().unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,4 +40,4 @@ pub fn main() {
|
||||
j2.join().unwrap();
|
||||
j3.join().unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,4 +44,4 @@ pub fn main() {
|
||||
j2.join().unwrap();
|
||||
j3.join().unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,4 +41,4 @@ pub fn main() {
|
||||
j2.join().unwrap();
|
||||
j3.join().unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,4 +24,4 @@ pub fn main() {
|
||||
j1.join().unwrap();
|
||||
j2.join().unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -119,4 +119,4 @@ pub fn main() {
|
||||
test_multiple_reads();
|
||||
test_rmw_no_block();
|
||||
test_release_no_block();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user