move vector_clock and sync into concurrency & make vector_clock private
move thread it back
This commit is contained in:
parent
ab88e64b15
commit
b073fe2537
@ -54,7 +54,10 @@
|
||||
|
||||
use crate::*;
|
||||
|
||||
use super::weak_memory::EvalContextExt as _;
|
||||
use super::{
|
||||
vector_clock::{VClock, VTimestamp, VectorIdx},
|
||||
weak_memory::EvalContextExt as _,
|
||||
};
|
||||
|
||||
pub type AllocExtra = VClockAlloc;
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
pub mod data_race;
|
||||
mod range_object_map;
|
||||
pub mod sync;
|
||||
mod vector_clock;
|
||||
pub mod weak_memory;
|
||||
|
@ -7,6 +7,7 @@
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_index::vec::{Idx, IndexVec};
|
||||
|
||||
use super::vector_clock::VClock;
|
||||
use crate::*;
|
||||
|
||||
/// We cannot use the `newtype_index!` macro because we have to use 0 as a
|
||||
@ -150,7 +151,7 @@ struct FutexWaiter {
|
||||
|
||||
/// The state of all synchronization variables.
|
||||
#[derive(Default, Debug)]
|
||||
pub(super) struct SynchronizationState {
|
||||
pub(crate) struct SynchronizationState {
|
||||
mutexes: IndexVec<MutexId, Mutex>,
|
||||
rwlocks: IndexVec<RwLockId, RwLock>,
|
||||
condvars: IndexVec<CondvarId, Condvar>,
|
@ -87,6 +87,7 @@
|
||||
use super::{
|
||||
data_race::{GlobalState as DataRaceState, ThreadClockSet},
|
||||
range_object_map::{AccessType, RangeObjectMap},
|
||||
vector_clock::{VClock, VTimestamp, VectorIdx},
|
||||
};
|
||||
|
||||
pub type AllocExtra = StoreBufferAlloc;
|
||||
|
16
src/lib.rs
16
src/lib.rs
@ -61,9 +61,7 @@
|
||||
mod range_map;
|
||||
mod shims;
|
||||
mod stacked_borrows;
|
||||
mod sync;
|
||||
mod thread;
|
||||
mod vector_clock;
|
||||
pub mod thread;
|
||||
|
||||
// Establish a "crate-wide prelude": we often import `crate::*`.
|
||||
|
||||
@ -87,17 +85,17 @@
|
||||
EvalContextExt as DataRaceEvalContextExt,
|
||||
};
|
||||
pub use crate::diagnostics::{
|
||||
register_diagnostic, report_error, EvalContextExt as DiagnosticsEvalContextExt,
|
||||
NonHaltingDiagnostic, TerminationInfo,
|
||||
EvalContextExt as DiagnosticsEvalContextExt, NonHaltingDiagnostic, register_diagnostic,
|
||||
report_error, TerminationInfo,
|
||||
};
|
||||
pub use crate::eval::{
|
||||
create_ecx, eval_entry, AlignmentCheck, BacktraceStyle, IsolatedOp, MiriConfig, RejectOpWith,
|
||||
AlignmentCheck, BacktraceStyle, create_ecx, eval_entry, IsolatedOp, MiriConfig, RejectOpWith,
|
||||
};
|
||||
pub use crate::helpers::{CurrentSpan, EvalContextExt as HelpersEvalContextExt};
|
||||
pub use crate::intptrcast::ProvenanceMode;
|
||||
pub use crate::machine::{
|
||||
AllocExtra, Evaluator, FrameData, MiriEvalContext, MiriEvalContextExt, MiriMemoryKind,
|
||||
Provenance, ProvenanceExtra, NUM_CPUS, PAGE_SIZE, STACK_ADDR, STACK_SIZE,
|
||||
NUM_CPUS, PAGE_SIZE, Provenance, ProvenanceExtra, STACK_ADDR, STACK_SIZE,
|
||||
};
|
||||
pub use crate::mono_hash_map::MonoHashMap;
|
||||
pub use crate::operator::EvalContextExt as OperatorEvalContextExt;
|
||||
@ -105,12 +103,10 @@
|
||||
pub use crate::stacked_borrows::{
|
||||
CallId, EvalContextExt as StackedBorEvalContextExt, Item, Permission, SbTag, Stack, Stacks,
|
||||
};
|
||||
pub use crate::sync::{CondvarId, EvalContextExt as SyncEvalContextExt, MutexId, RwLockId};
|
||||
pub use concurrency::sync::{CondvarId, EvalContextExt as SyncEvalContextExt, MutexId, RwLockId};
|
||||
pub use crate::thread::{
|
||||
EvalContextExt as ThreadsEvalContextExt, SchedulingAction, ThreadId, ThreadManager, ThreadState,
|
||||
};
|
||||
pub use crate::vector_clock::{VClock, VTimestamp, VectorIdx};
|
||||
|
||||
/// Insert rustc arguments at the beginning of the argument list that Miri wants to be
|
||||
/// set per default, for maximal validation power.
|
||||
pub const MIRI_DEFAULT_ARGS: &[&str] = &[
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::time::{Duration, Instant, SystemTime};
|
||||
|
||||
use crate::thread::Time;
|
||||
use crate::*;
|
||||
use thread::Time;
|
||||
|
||||
/// Returns the time elapsed between the provided time and the unix epoch as a `Duration`.
|
||||
pub fn system_time_to_duration<'tcx>(time: &SystemTime) -> InterpResult<'tcx, Duration> {
|
||||
|
@ -3,8 +3,8 @@
|
||||
use rustc_hir::LangItem;
|
||||
use rustc_middle::ty::{layout::TyAndLayout, query::TyCtxtAt, subst::Subst, Ty};
|
||||
|
||||
use crate::thread::Time;
|
||||
use crate::*;
|
||||
use thread::Time;
|
||||
|
||||
// pthread_mutexattr_t is either 4 or 8 bytes, depending on the platform.
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
use rustc_target::spec::abi::Abi;
|
||||
|
||||
use crate::concurrency::data_race;
|
||||
use crate::sync::SynchronizationState;
|
||||
use crate::concurrency::sync::SynchronizationState;
|
||||
use crate::*;
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
|
Loading…
Reference in New Issue
Block a user