Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion shuttle/src/sync/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl<T: ?Sized> Mutex<T> {
/// 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()
Expand All @@ -155,6 +155,11 @@ impl<T: ?Sized> Mutex<T> {

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
Expand Down
6 changes: 6 additions & 0 deletions shuttle/src/sync/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@ impl<T: ?Sized> RwLock<T> {

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
Expand Down
Loading