mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
sync: Make Lock more similar to std::sync::Mutex (#1573)
This renames `Lock` to `Mutex`, and brings the API more in line with `std::sync::Mutex`. In partcular, locking now only takes `&self`, with the expectation that you place the `Mutex` in an `Arc` (or something similar) to share it between threads. Fixes #1544. Part of #1210.
This commit is contained in:
@@ -29,13 +29,13 @@ macro_rules! if_fuzz {
|
||||
}}
|
||||
}
|
||||
|
||||
mod lock;
|
||||
mod loom;
|
||||
pub mod mpsc;
|
||||
mod mutex;
|
||||
pub mod oneshot;
|
||||
pub mod semaphore;
|
||||
mod task;
|
||||
pub mod watch;
|
||||
|
||||
pub use lock::{Lock, LockGuard};
|
||||
pub use mutex::{Mutex, MutexGuard};
|
||||
pub use task::AtomicWaker;
|
||||
|
||||
Reference in New Issue
Block a user