summaryrefslogtreecommitdiff
path: root/src/rwlock.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2025-03-12 22:19:38 -0400
committerMica White <botahamec@outlook.com>2025-03-12 22:19:38 -0400
commitf347b3e7ca771f11a21d2f6e54c0d97796174d37 (patch)
tree6776aa84a0fb91f5619f9669f083e0316f0526b9 /src/rwlock.rs
parent58abf5872023aca7ee6459fa3b2e067d57923ba5 (diff)
Add unwind handling for scoped locks
Diffstat (limited to 'src/rwlock.rs')
-rw-r--r--src/rwlock.rs7
1 files changed, 5 insertions, 2 deletions
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<T: ?Sized, R> {
///
/// [`LockCollection`]: `crate::LockCollection`
#[repr(transparent)]
-pub struct ReadLock<'l, T: ?Sized, R>(&'l RwLock<T, R>);
+struct ReadLock<'l, T: ?Sized, R>(&'l RwLock<T, R>);
/// Grants write access to an [`RwLock`]
///
@@ -67,7 +67,7 @@ pub struct ReadLock<'l, T: ?Sized, R>(&'l RwLock<T, R>);
///
/// [`LockCollection`]: `crate::LockCollection`
#[repr(transparent)]
-pub struct WriteLock<'l, T: ?Sized, R>(&'l RwLock<T, R>);
+struct WriteLock<'l, T: ?Sized, R>(&'l RwLock<T, R>);
/// 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");