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
|
|
@ -82,9 +82,11 @@ impl RwLock {
|
|||
let rwl = self.raw();
|
||||
expect_success_aborting(unsafe { abi::rwl_unl_rwl(rwl) }, &"rwl_unl_rwl");
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for RwLock {
|
||||
#[inline]
|
||||
pub unsafe fn destroy(&self) {
|
||||
fn drop(&mut self) {
|
||||
if let Some(rwl) = self.rwl.get().map(|x| x.0) {
|
||||
expect_success_aborting(unsafe { abi::rwl_del_rwl(rwl) }, &"rwl_del_rwl");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue