about summary refs log tree commit diff
diff options
context:
space:
mode:
authorjoboet <jonasboettiger@icloud.com>2022-11-14 14:25:44 +0100
committerjoboet <jonasboettiger@icloud.com>2022-11-14 14:25:44 +0100
commitc66494474cc64aaf4f1e51b428d53e7dcbd14c25 (patch)
tree4febee9e99bfbd8339df2f6d9a96783dfff557ed
parent96ddd32c4bfb1d78f0cd03eb068b1710a8cebeef (diff)
downloadrust-c66494474cc64aaf4f1e51b428d53e7dcbd14c25.tar.gz
rust-c66494474cc64aaf4f1e51b428d53e7dcbd14c25.zip
std: move `ReentrantMutex` to `sync`
-rw-r--r--library/std/src/io/stdio.rs3
-rw-r--r--library/std/src/sync/mod.rs3
-rw-r--r--library/std/src/sync/remutex.rs (renamed from library/std/src/sys_common/remutex.rs)0
-rw-r--r--library/std/src/sync/remutex/tests.rs (renamed from library/std/src/sys_common/remutex/tests.rs)2
-rw-r--r--library/std/src/sys_common/mod.rs1
5 files changed, 5 insertions, 4 deletions
diff --git a/library/std/src/io/stdio.rs b/library/std/src/io/stdio.rs
index 1141a957d87..14bfef4c7aa 100644
--- a/library/std/src/io/stdio.rs
+++ b/library/std/src/io/stdio.rs
@@ -10,9 +10,8 @@ use crate::fmt;
 use crate::fs::File;
 use crate::io::{self, BufReader, IoSlice, IoSliceMut, LineWriter, Lines};
 use crate::sync::atomic::{AtomicBool, Ordering};
-use crate::sync::{Arc, Mutex, MutexGuard, OnceLock};
+use crate::sync::{Arc, Mutex, MutexGuard, OnceLock, ReentrantMutex, ReentrantMutexGuard};
 use crate::sys::stdio;
-use crate::sys_common::remutex::{ReentrantMutex, ReentrantMutexGuard};
 
 type LocalStream = Arc<Mutex<Vec<u8>>>;
 
diff --git a/library/std/src/sync/mod.rs b/library/std/src/sync/mod.rs
index 4fee8d3e92f..ba20bab87a4 100644
--- a/library/std/src/sync/mod.rs
+++ b/library/std/src/sync/mod.rs
@@ -177,6 +177,8 @@ pub use self::lazy_lock::LazyLock;
 #[unstable(feature = "once_cell", issue = "74465")]
 pub use self::once_lock::OnceLock;
 
+pub(crate) use self::remutex::{ReentrantMutex, ReentrantMutexGuard};
+
 pub mod mpsc;
 
 mod barrier;
@@ -187,4 +189,5 @@ mod mutex;
 mod once;
 mod once_lock;
 mod poison;
+mod remutex;
 mod rwlock;
diff --git a/library/std/src/sys_common/remutex.rs b/library/std/src/sync/remutex.rs
index 4c054da6471..4c054da6471 100644
--- a/library/std/src/sys_common/remutex.rs
+++ b/library/std/src/sync/remutex.rs
diff --git a/library/std/src/sys_common/remutex/tests.rs b/library/std/src/sync/remutex/tests.rs
index 8e97ce11c34..fc553081d42 100644
--- a/library/std/src/sys_common/remutex/tests.rs
+++ b/library/std/src/sync/remutex/tests.rs
@@ -1,6 +1,6 @@
+use super::{ReentrantMutex, ReentrantMutexGuard};
 use crate::cell::RefCell;
 use crate::sync::Arc;
-use crate::sys_common::remutex::{ReentrantMutex, ReentrantMutexGuard};
 use crate::thread;
 
 #[test]
diff --git a/library/std/src/sys_common/mod.rs b/library/std/src/sys_common/mod.rs
index 069b13e9d85..9bf2739deae 100644
--- a/library/std/src/sys_common/mod.rs
+++ b/library/std/src/sys_common/mod.rs
@@ -27,7 +27,6 @@ pub mod lazy_box;
 pub mod memchr;
 pub mod once;
 pub mod process;
-pub mod remutex;
 pub mod thread;
 pub mod thread_info;
 pub mod thread_local_dtor;