summaryrefslogtreecommitdiff
path: root/src/mutex/guard.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2024-03-13 22:44:46 -0400
committerMica White <botahamec@outlook.com>2024-03-13 22:44:46 -0400
commit7bd236853ef5ae705328c8fdc492cf60fc6887c1 (patch)
treeec4e9dced562fdae618b98ac704074c0ddc9cc41 /src/mutex/guard.rs
parent7c6f49b6570669098938dc332a4f3e85dd3d217d (diff)
Lockable overhaul
Diffstat (limited to 'src/mutex/guard.rs')
-rw-r--r--src/mutex/guard.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mutex/guard.rs b/src/mutex/guard.rs
index c7f25e4..38ea125 100644
--- a/src/mutex/guard.rs
+++ b/src/mutex/guard.rs
@@ -35,6 +35,12 @@ impl<'a, T: ?Sized + 'a, R: RawMutex> DerefMut for MutexRef<'a, T, R> {
}
}
+impl<'a, T: ?Sized + 'a, R: RawMutex> MutexRef<'a, T, R> {
+ pub unsafe fn new(mutex: &'a Mutex<T, R>) -> Self {
+ Self(mutex, PhantomData)
+ }
+}
+
impl<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable, R: RawMutex> Deref
for MutexGuard<'a, 'key, T, Key, R>
{