diff options
| author | Mica White <botahamec@gmail.com> | 2024-12-26 11:06:23 -0500 |
|---|---|---|
| committer | Mica White <botahamec@gmail.com> | 2024-12-26 11:26:29 -0500 |
| commit | 096afea6f13692fddbfad0b07e5377cb2e81dd58 (patch) | |
| tree | 53c252e3277683e7e8686539fde83e6cc5e1762d /src/collection/boxed.rs | |
| parent | a060123077b94f61e3d0802a6977ad547276fd1b (diff) | |
Rename kill to poison
Diffstat (limited to 'src/collection/boxed.rs')
| -rw-r--r-- | src/collection/boxed.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/collection/boxed.rs b/src/collection/boxed.rs index 2397bd3..a048d2b 100644 --- a/src/collection/boxed.rs +++ b/src/collection/boxed.rs @@ -21,9 +21,9 @@ fn contains_duplicates(l: &[&dyn RawLock]) -> bool { } unsafe impl<L: Lockable> RawLock for BoxedLockCollection<L> { - fn kill(&self) { + fn poison(&self) { for lock in &self.locks { - lock.kill(); + lock.poison(); } } @@ -196,6 +196,8 @@ impl<L> BoxedLockCollection<L> { self.locks.clear(); // safety: this was allocated using a box, and is now unique let boxed: Box<UnsafeCell<L>> = Box::from_raw(self.data.cast_mut()); + // to prevent a double free + std::mem::forget(self); boxed.into_inner() } |
