Trait miri::concurrency::data_race::EvalContextPrivExt
source · [−]trait EvalContextPrivExt<'mir, 'tcx: 'mir>: MiriEvalContextExt<'mir, 'tcx> {
fn allow_data_races_ref<R>(
&self,
op: impl FnOnce(&MiriEvalContext<'mir, 'tcx>) -> R
) -> R { ... }
fn allow_data_races_mut<R>(
&mut self,
op: impl FnOnce(&mut MiriEvalContext<'mir, 'tcx>) -> R
) -> R { ... }
fn validate_atomic_op<A: Debug + Copy>(
&self,
place: &MPlaceTy<'tcx, Provenance>,
atomic: A,
description: &str,
op: impl FnMut(&mut MemoryCellClocks, &mut ThreadClockSet, VectorIdx, A) -> Result<(), DataRace>
) -> InterpResult<'tcx> { ... }
}Provided Methods
fn allow_data_races_ref<R>(
&self,
op: impl FnOnce(&MiriEvalContext<'mir, 'tcx>) -> R
) -> R
fn allow_data_races_ref<R>(
&self,
op: impl FnOnce(&MiriEvalContext<'mir, 'tcx>) -> R
) -> R
Temporarily allow data-races to occur. This should only be used in one of these cases:
- One of the appropriate
validate_atomicfunctions will be called to to treat a memory access as atomic. - The memory being accessed should be treated as internal state, that cannot be accessed by the interpreted program.
- Execution of the interpreted program execution has halted.
fn allow_data_races_mut<R>(
&mut self,
op: impl FnOnce(&mut MiriEvalContext<'mir, 'tcx>) -> R
) -> R
fn allow_data_races_mut<R>(
&mut self,
op: impl FnOnce(&mut MiriEvalContext<'mir, 'tcx>) -> R
) -> R
Same as allow_data_races_ref, this temporarily disables any data-race detection and
so should only be used for atomic operations or internal state that the program cannot
access.
fn validate_atomic_op<A: Debug + Copy>(
&self,
place: &MPlaceTy<'tcx, Provenance>,
atomic: A,
description: &str,
op: impl FnMut(&mut MemoryCellClocks, &mut ThreadClockSet, VectorIdx, A) -> Result<(), DataRace>
) -> InterpResult<'tcx>
fn validate_atomic_op<A: Debug + Copy>(
&self,
place: &MPlaceTy<'tcx, Provenance>,
atomic: A,
description: &str,
op: impl FnMut(&mut MemoryCellClocks, &mut ThreadClockSet, VectorIdx, A) -> Result<(), DataRace>
) -> InterpResult<'tcx>
Generic atomic operation implementation