Add `into_inner` methods. (#3110)
This commit is contained in:
parent
46daaa8a34
commit
20be0847c8
|
|
@ -82,6 +82,11 @@ mod mutex_impl {
|
|||
|
||||
MutexGuard(self.0.lock(), ptr)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn into_inner(self) -> T {
|
||||
self.0.into_inner()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Drop for MutexGuard<'_, T> {
|
||||
|
|
@ -314,6 +319,11 @@ mod rw_lock_impl {
|
|||
holders: Arc::clone(&self.holders),
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn into_inner(self) -> T {
|
||||
self.lock.into_inner()
|
||||
}
|
||||
}
|
||||
|
||||
fn make_backtrace() -> backtrace::Backtrace {
|
||||
|
|
@ -366,6 +376,11 @@ mod mutex_impl {
|
|||
pub fn lock(&self) -> MutexGuard<'_, T> {
|
||||
self.0.borrow_mut()
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn into_inner(self) -> T {
|
||||
self.0.into_inner()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -401,6 +416,11 @@ mod rw_lock_impl {
|
|||
pub fn write(&self) -> RwLockWriteGuard<'_, T> {
|
||||
self.0.borrow_mut()
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn into_inner(self) -> T {
|
||||
self.0.into_inner()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue