mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-28 00:00:11 +02:00
tokio-sync: Add async mutual exclusion primitive (#964)
This PR introduces `Lock`: A concurrency primitive built on top of `Semaphore` that provides a `Mutex`-like primitive that interacts nicely with futures. Specifically, `LockGuard` (in contrast to `MutexGuard`) does _not_ borrow the `Lock`, and can thus be passed into a future where it will later be unlocked. This replaces #958, which attempted to introduce a less generic version. The primitive proposed there will instead live in [`async-lease`](https://github.com/jonhoo/async-lease).
This commit is contained in:
committed by
Lucio Franco
parent
7e51ab05e9
commit
cf06621998
@@ -24,6 +24,7 @@ macro_rules! if_fuzz {
|
||||
}}
|
||||
}
|
||||
|
||||
pub mod lock;
|
||||
mod loom;
|
||||
pub mod mpsc;
|
||||
pub mod oneshot;
|
||||
|
||||
Reference in New Issue
Block a user