Skip to content

Commit 53138c6

Browse files
committed
Auto merge of #2504 - Hiroki6:move-thread-to-concurrency-module, r=RalfJung
move thread.rs into concurrency Follow-up of #2500 and closes #2199 I moved the `thread.rs` into the `concurrency` module.
2 parents e0f0e1f + 2107cbb commit 53138c6

File tree

6 files changed

+15
-11
lines changed

6 files changed

+15
-11
lines changed

src/concurrency/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pub mod data_race;
22
mod range_object_map;
33
pub mod sync;
4+
pub mod thread;
45
mod vector_clock;
56
pub mod weak_memory;
File renamed without changes.

src/lib.rs

+11-8
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ mod operator;
6262
mod range_map;
6363
mod shims;
6464
mod stacked_borrows;
65-
pub mod thread;
6665

6766
// Establish a "crate-wide prelude": we often import `crate::*`.
6867

@@ -81,9 +80,16 @@ pub use crate::shims::time::EvalContextExt as _;
8180
pub use crate::shims::tls::{EvalContextExt as _, TlsData};
8281
pub use crate::shims::EvalContextExt as _;
8382

84-
pub use crate::concurrency::data_race::{
85-
AtomicFenceOrd, AtomicReadOrd, AtomicRwOrd, AtomicWriteOrd,
86-
EvalContextExt as DataRaceEvalContextExt,
83+
pub use crate::concurrency::{
84+
data_race::{
85+
AtomicFenceOrd, AtomicReadOrd, AtomicRwOrd, AtomicWriteOrd,
86+
EvalContextExt as DataRaceEvalContextExt,
87+
},
88+
sync::{CondvarId, EvalContextExt as SyncEvalContextExt, MutexId, RwLockId},
89+
thread::{
90+
EvalContextExt as ThreadsEvalContextExt, SchedulingAction, ThreadId, ThreadManager,
91+
ThreadState,
92+
},
8793
};
8894
pub use crate::diagnostics::{
8995
register_diagnostic, report_error, EvalContextExt as DiagnosticsEvalContextExt,
@@ -104,10 +110,7 @@ pub use crate::range_map::RangeMap;
104110
pub use crate::stacked_borrows::{
105111
CallId, EvalContextExt as StackedBorEvalContextExt, Item, Permission, SbTag, Stack, Stacks,
106112
};
107-
pub use crate::thread::{
108-
EvalContextExt as ThreadsEvalContextExt, SchedulingAction, ThreadId, ThreadManager, ThreadState,
109-
};
110-
pub use concurrency::sync::{CondvarId, EvalContextExt as SyncEvalContextExt, MutexId, RwLockId};
113+
111114
/// Insert rustc arguments at the beginning of the argument list that Miri wants to be
112115
/// set per default, for maximal validation power.
113116
pub const MIRI_DEFAULT_ARGS: &[&str] = &[

src/shims/time.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::time::{Duration, Instant, SystemTime};
22

3-
use crate::thread::Time;
3+
use crate::concurrency::thread::Time;
44
use crate::*;
55

66
/// Returns the time elapsed between the provided time and the unix epoch as a `Duration`.

src/shims/unix/linux/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::thread::Time;
1+
use crate::concurrency::thread::Time;
22
use crate::*;
33
use rustc_target::abi::{Align, Size};
44
use std::time::{Instant, SystemTime};

src/shims/unix/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::time::SystemTime;
33
use rustc_hir::LangItem;
44
use rustc_middle::ty::{layout::TyAndLayout, query::TyCtxtAt, subst::Subst, Ty};
55

6-
use crate::thread::Time;
6+
use crate::concurrency::thread::Time;
77
use crate::*;
88

99
// pthread_mutexattr_t is either 4 or 8 bytes, depending on the platform.

0 commit comments

Comments
 (0)