Skip to content

Commit d914328

Browse files
authored
Rollup merge of #104402 - joboet:sync_remutex, r=m-ou-se
Move `ReentrantMutex` to `std::sync` If I understand #84187 correctly, `sys_common` should not contain platform-independent code, even if it is private.
2 parents 270c94e + c664944 commit d914328

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

library/std/src/io/stdio.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ use crate::fmt;
1010
use crate::fs::File;
1111
use crate::io::{self, BufReader, IoSlice, IoSliceMut, LineWriter, Lines};
1212
use crate::sync::atomic::{AtomicBool, Ordering};
13-
use crate::sync::{Arc, Mutex, MutexGuard, OnceLock};
13+
use crate::sync::{Arc, Mutex, MutexGuard, OnceLock, ReentrantMutex, ReentrantMutexGuard};
1414
use crate::sys::stdio;
15-
use crate::sys_common::remutex::{ReentrantMutex, ReentrantMutexGuard};
1615

1716
type LocalStream = Arc<Mutex<Vec<u8>>>;
1817

library/std/src/sync/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ pub use self::lazy_lock::LazyLock;
177177
#[unstable(feature = "once_cell", issue = "74465")]
178178
pub use self::once_lock::OnceLock;
179179

180+
pub(crate) use self::remutex::{ReentrantMutex, ReentrantMutexGuard};
181+
180182
pub mod mpsc;
181183

182184
mod barrier;
@@ -187,4 +189,5 @@ mod mutex;
187189
mod once;
188190
mod once_lock;
189191
mod poison;
192+
mod remutex;
190193
mod rwlock;

library/std/src/sys_common/remutex/tests.rs renamed to library/std/src/sync/remutex/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use super::{ReentrantMutex, ReentrantMutexGuard};
12
use crate::cell::RefCell;
23
use crate::sync::Arc;
3-
use crate::sys_common::remutex::{ReentrantMutex, ReentrantMutexGuard};
44
use crate::thread;
55

66
#[test]

library/std/src/sys_common/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pub mod lazy_box;
2727
pub mod memchr;
2828
pub mod once;
2929
pub mod process;
30-
pub mod remutex;
3130
pub mod thread;
3231
pub mod thread_info;
3332
pub mod thread_local_dtor;

0 commit comments

Comments
 (0)