From f347b3e7ca771f11a21d2f6e54c0d97796174d37 Mon Sep 17 00:00:00 2001 From: Mica White Date: Wed, 12 Mar 2025 22:19:38 -0400 Subject: Add unwind handling for scoped locks --- src/rwlock.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/rwlock.rs') diff --git a/src/rwlock.rs b/src/rwlock.rs index 2d3dd85..f5c0ec5 100644 --- a/src/rwlock.rs +++ b/src/rwlock.rs @@ -58,7 +58,7 @@ pub struct RwLock { /// /// [`LockCollection`]: `crate::LockCollection` #[repr(transparent)] -pub struct ReadLock<'l, T: ?Sized, R>(&'l RwLock); +struct ReadLock<'l, T: ?Sized, R>(&'l RwLock); /// Grants write access to an [`RwLock`] /// @@ -67,7 +67,7 @@ pub struct ReadLock<'l, T: ?Sized, R>(&'l RwLock); /// /// [`LockCollection`]: `crate::LockCollection` #[repr(transparent)] -pub struct WriteLock<'l, T: ?Sized, R>(&'l RwLock); +struct WriteLock<'l, T: ?Sized, R>(&'l RwLock); /// RAII structure that unlocks the shared read access to a [`RwLock`] /// @@ -187,6 +187,7 @@ mod tests { } #[test] + #[ignore = "We've removed ReadLock"] fn read_lock_get_ptrs() { let rwlock = RwLock::new(5); let readlock = ReadLock::new(&rwlock); @@ -198,6 +199,7 @@ mod tests { } #[test] + #[ignore = "We've removed WriteLock"] fn write_lock_get_ptrs() { let rwlock = RwLock::new(5); let writelock = WriteLock::new(&rwlock); @@ -446,6 +448,7 @@ mod tests { } #[test] + #[ignore = "We've removed ReadLock"] fn read_lock_in_collection() { let mut key = ThreadKey::get().unwrap(); let lock = crate::RwLock::new("hi"); -- cgit v1.2.3