summaryrefslogtreecommitdiff
path: root/src/rwlock/write_guard.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2025-03-09 20:49:56 -0400
committerMica White <botahamec@outlook.com>2025-03-09 20:49:56 -0400
commit58abf5872023aca7ee6459fa3b2e067d57923ba5 (patch)
tree196cadda0dd4386668477ef286f9c9b09480e713 /src/rwlock/write_guard.rs
parent4ba03be97e6cc7e790bbc9bfc18caaa228c8a262 (diff)
Finish testing and fixing
Diffstat (limited to 'src/rwlock/write_guard.rs')
-rw-r--r--src/rwlock/write_guard.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rwlock/write_guard.rs b/src/rwlock/write_guard.rs
index 3fabf8e..c7676b5 100644
--- a/src/rwlock/write_guard.rs
+++ b/src/rwlock/write_guard.rs
@@ -71,7 +71,7 @@ impl<T: ?Sized, R: RawRwLock> Drop for RwLockWriteRef<'_, T, R> {
fn drop(&mut self) {
// safety: this guard is being destroyed, so the data cannot be
// accessed without locking again
- unsafe { self.0.raw_unlock() }
+ unsafe { self.0.raw_unlock_write() }
}
}
@@ -79,7 +79,7 @@ impl<'a, T: ?Sized + 'a, R: RawRwLock> RwLockWriteRef<'a, T, R> {
/// Creates a reference to the underlying data of an [`RwLock`] without
/// locking or taking ownership of the key.
#[must_use]
- pub(crate) unsafe fn new(mutex: &'a RwLock<T, R>) -> Self {
+ pub(crate) const unsafe fn new(mutex: &'a RwLock<T, R>) -> Self {
Self(mutex, PhantomData)
}
}
@@ -136,7 +136,7 @@ impl<'a, T: ?Sized + 'a, R: RawRwLock> RwLockWriteGuard<'a, T, R> {
/// Create a guard to the given mutex. Undefined if multiple guards to the
/// same mutex exist at once.
#[must_use]
- pub(super) unsafe fn new(rwlock: &'a RwLock<T, R>, thread_key: ThreadKey) -> Self {
+ pub(super) const unsafe fn new(rwlock: &'a RwLock<T, R>, thread_key: ThreadKey) -> Self {
Self {
rwlock: RwLockWriteRef(rwlock, PhantomData),
thread_key,