diff options
author | Eliza Weisman <eliza@buoyant.io> | 2020-04-29 15:48:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-29 15:48:08 -0700 |
commit | 45773c56413267cbcf9d5e7877e8dc4afc1e5b07 (patch) | |
tree | 8d1353dac8323fbc6f85558b6250051f25e4d574 /tokio/src/sync/mod.rs | |
parent | c52b78b7925f883289853dee5748b93a89e29bb1 (diff) |
mutex: add `OwnedMutexGuard` for `Arc<Mutex<T>>`s (#2455)
This PR adds a new `OwnedMutexGuard` type and `lock_owned` and
`try_lock_owned` methods for `Arc<Mutex<T>>`. This is pretty much the
same as the similar APIs added in #2421.
I've also corrected some existing documentation that incorrectly
implied that the existing `lock` method cloned an internal `Arc` — I
think this may be a holdover from `tokio` 0.1's `Lock` type?
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Diffstat (limited to 'tokio/src/sync/mod.rs')
-rw-r--r-- | tokio/src/sync/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tokio/src/sync/mod.rs b/tokio/src/sync/mod.rs index 263ec62c..359b14f5 100644 --- a/tokio/src/sync/mod.rs +++ b/tokio/src/sync/mod.rs @@ -428,7 +428,7 @@ cfg_sync! { pub mod mpsc; mod mutex; - pub use mutex::{Mutex, MutexGuard, TryLockError}; + pub use mutex::{Mutex, MutexGuard, TryLockError, OwnedMutexGuard}; mod notify; pub use notify::Notify; |