summaryrefslogtreecommitdiff
path: root/src/rwlock/rwlock.rs
diff options
context:
space:
mode:
authorMica White <botahamec@gmail.com>2024-12-26 11:06:23 -0500
committerMica White <botahamec@gmail.com>2024-12-26 11:26:29 -0500
commit096afea6f13692fddbfad0b07e5377cb2e81dd58 (patch)
tree53c252e3277683e7e8686539fde83e6cc5e1762d /src/rwlock/rwlock.rs
parenta060123077b94f61e3d0802a6977ad547276fd1b (diff)
Rename kill to poison
Diffstat (limited to 'src/rwlock/rwlock.rs')
-rw-r--r--src/rwlock/rwlock.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rwlock/rwlock.rs b/src/rwlock/rwlock.rs
index 66c7362..8bb170c 100644
--- a/src/rwlock/rwlock.rs
+++ b/src/rwlock/rwlock.rs
@@ -14,7 +14,7 @@ use crate::lockable::{
use super::{PoisonFlag, RwLock, RwLockReadGuard, RwLockReadRef, RwLockWriteGuard, RwLockWriteRef};
unsafe impl<T: ?Sized, R: RawRwLock> RawLock for RwLock<T, R> {
- fn kill(&self) {
+ fn poison(&self) {
self.poison.poison();
}
@@ -26,7 +26,7 @@ unsafe impl<T: ?Sized, R: RawRwLock> RawLock for RwLock<T, R> {
// if the closure unwraps, then the mutex will be killed
let this = AssertUnwindSafe(self);
- handle_unwind(|| this.raw.lock_exclusive(), || self.kill())
+ handle_unwind(|| this.raw.lock_exclusive(), || self.poison())
}
unsafe fn raw_try_lock(&self) -> bool {
@@ -36,13 +36,13 @@ unsafe impl<T: ?Sized, R: RawRwLock> RawLock for RwLock<T, R> {
// if the closure unwraps, then the mutex will be killed
let this = AssertUnwindSafe(self);
- handle_unwind(|| this.raw.try_lock_exclusive(), || self.kill())
+ handle_unwind(|| this.raw.try_lock_exclusive(), || self.poison())
}
unsafe fn raw_unlock(&self) {
// if the closure unwraps, then the mutex will be killed
let this = AssertUnwindSafe(self);
- handle_unwind(|| this.raw.unlock_exclusive(), || self.kill())
+ handle_unwind(|| this.raw.unlock_exclusive(), || self.poison())
}
unsafe fn raw_read(&self) {
@@ -53,7 +53,7 @@ unsafe impl<T: ?Sized, R: RawRwLock> RawLock for RwLock<T, R> {
// if the closure unwraps, then the mutex will be killed
let this = AssertUnwindSafe(self);
- handle_unwind(|| this.raw.lock_shared(), || self.kill())
+ handle_unwind(|| this.raw.lock_shared(), || self.poison())
}
unsafe fn raw_try_read(&self) -> bool {
@@ -63,13 +63,13 @@ unsafe impl<T: ?Sized, R: RawRwLock> RawLock for RwLock<T, R> {
// if the closure unwraps, then the mutex will be killed
let this = AssertUnwindSafe(self);
- handle_unwind(|| this.raw.try_lock_shared(), || self.kill())
+ handle_unwind(|| this.raw.try_lock_shared(), || self.poison())
}
unsafe fn raw_unlock_read(&self) {
// if the closure unwraps, then the mutex will be killed
let this = AssertUnwindSafe(self);
- handle_unwind(|| this.raw.unlock_shared(), || self.kill())
+ handle_unwind(|| this.raw.unlock_shared(), || self.poison())
}
}