From 5dfd1f7a7734038eed310729e907313e7b499d68 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 8 Jan 2022 19:53:21 -0500 Subject: cleanups --- src/mutex.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mutex.rs') diff --git a/src/mutex.rs b/src/mutex.rs index aca5669..1c6faff 100644 --- a/src/mutex.rs +++ b/src/mutex.rs @@ -1,9 +1,14 @@ pub type Mutex = async_std::sync::Arc>; +pub type Guard = async_std::sync::MutexGuardArc; pub fn new(t: T) -> async_std::sync::Arc> { async_std::sync::Arc::new(async_std::sync::Mutex::new(t)) } +pub fn clone(m: &Mutex) -> Mutex { + async_std::sync::Arc::clone(m) +} + pub fn unwrap(t: Mutex) -> Option { if let Ok(mutex) = async_std::sync::Arc::try_unwrap(t) { Some(async_std::sync::Mutex::into_inner(mutex)) -- cgit v1.2.3-54-g00ecf