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 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