From 58abf5872023aca7ee6459fa3b2e067d57923ba5 Mon Sep 17 00:00:00 2001 From: Mica White Date: Sun, 9 Mar 2025 20:49:56 -0400 Subject: Finish testing and fixing --- src/mutex/guard.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mutex/guard.rs') diff --git a/src/mutex/guard.rs b/src/mutex/guard.rs index 22e59c1..d88fded 100644 --- a/src/mutex/guard.rs +++ b/src/mutex/guard.rs @@ -39,7 +39,7 @@ impl Drop for MutexRef<'_, 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, R: RawMutex> MutexRef<'a, T, R> { /// Creates a reference to the underlying data of a mutex without /// attempting to lock it or take ownership of the key. But it's also quite /// dangerous to drop. - pub(crate) unsafe fn new(mutex: &'a Mutex) -> Self { + pub(crate) const unsafe fn new(mutex: &'a Mutex) -> Self { Self(mutex, PhantomData) } } @@ -139,7 +139,7 @@ impl<'a, T: ?Sized, R: RawMutex> MutexGuard<'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(mutex: &'a Mutex, thread_key: ThreadKey) -> Self { + pub(super) const unsafe fn new(mutex: &'a Mutex, thread_key: ThreadKey) -> Self { Self { mutex: MutexRef(mutex, PhantomData), thread_key, -- cgit v1.2.3