Use Drop instead of destroy() for locks.
This commit is contained in:
parent
fb1976011e
commit
ac5aa1ded5
24 changed files with 39 additions and 87 deletions
|
|
@ -117,8 +117,6 @@ impl Condvar {
|
|||
unsafe { mutex.lock() };
|
||||
success
|
||||
}
|
||||
|
||||
pub unsafe fn destroy(&self) {}
|
||||
}
|
||||
|
||||
mod waiter_queue {
|
||||
|
|
|
|||
|
|
@ -64,8 +64,10 @@ impl Mutex {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub unsafe fn destroy(&self) {
|
||||
impl Drop for Mutex {
|
||||
fn drop(&mut self) {
|
||||
if let Some(mtx) = self.mtx.get().map(|x| x.0) {
|
||||
expect_success_aborting(unsafe { abi::del_mtx(mtx) }, &"del_mtx");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue