From 096afea6f13692fddbfad0b07e5377cb2e81dd58 Mon Sep 17 00:00:00 2001 From: Mica White Date: Thu, 26 Dec 2024 11:06:23 -0500 Subject: Rename kill to poison --- src/rwlock/rwlock.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/rwlock/rwlock.rs') 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 RawLock for RwLock { - fn kill(&self) { + fn poison(&self) { self.poison.poison(); } @@ -26,7 +26,7 @@ unsafe impl RawLock for RwLock { // 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 RawLock for RwLock { // 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 RawLock for RwLock { // 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 RawLock for RwLock { // 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()) } } -- cgit v1.2.3