From a532eb1390bf9e82824a71623091aff235d4825a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sarek=20H=C3=B8verstad=20Skot=C3=A5m?= Date: Fri, 21 Nov 2025 18:26:18 -0800 Subject: [PATCH 1/2] Add Mutex::clear_poison --- shuttle/src/sync/mutex.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/shuttle/src/sync/mutex.rs b/shuttle/src/sync/mutex.rs index 6174513b..a4ddefe0 100644 --- a/shuttle/src/sync/mutex.rs +++ b/shuttle/src/sync/mutex.rs @@ -136,7 +136,7 @@ impl Mutex { /// Returns a mutable reference to the underlying data. /// /// Since this call borrows the `Mutex` mutably, no actual locking needs to - /// take place---the mutable borrow statically guarantees no locks exist. + /// take place -- the mutable borrow statically guarantees no locks exist. #[inline] pub fn get_mut(&mut self) -> LockResult<&mut T> { self.inner.get_mut() @@ -155,6 +155,11 @@ impl Mutex { self.inner.into_inner() } + + /// Clear the poisoned state from a mutex. + pub fn clear_poison(&self) { + self.inner.clear_poison() + } } // Safety: Mutex is never actually passed across true threads, only across continuations. The From 636ceab5962444f597d172249f6673201c48059d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sarek=20H=C3=B8verstad=20Skot=C3=A5m?= Date: Fri, 21 Nov 2025 18:28:20 -0800 Subject: [PATCH 2/2] Add RwLock::clear_poison --- shuttle/src/sync/rwlock.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shuttle/src/sync/rwlock.rs b/shuttle/src/sync/rwlock.rs index d0b6c7ec..ebdc332e 100644 --- a/shuttle/src/sync/rwlock.rs +++ b/shuttle/src/sync/rwlock.rs @@ -298,6 +298,12 @@ impl RwLock { acquired } + + /// Clear the poisoned state from a lock. + #[inline] + pub fn clear_poison(&self) { + self.inner.clear_poison(); + } } // Safety: RwLock is never actually passed across true threads, only across continuations. The