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.
This commit is contained in:
Matthias Krüger 2022-12-28 22:22:17 +01:00 committed by GitHub
commit d91432832e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 4 deletions

View file

@ -10,9 +10,8 @@
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>>>;

View file

@ -177,6 +177,8 @@
#[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 once;
mod once_lock;
mod poison;
mod remutex;
mod rwlock;

View file

@ -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]

View file

@ -27,7 +27,6 @@
pub mod memchr;
pub mod once;
pub mod process;
pub mod remutex;
pub mod thread;
pub mod thread_info;
pub mod thread_local_dtor;