diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-02-25 17:32:58 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-02-25 17:32:58 -0500 |
commit | a2462bbaea13f7a3f3eb65e7430b30618bc203b8 (patch) | |
tree | 8cb2eab6904c2c9f4138f8221caa947c6b805d3b /src/mutex.rs | |
parent | 7b66471194490a1421001fd51d073cc6d18848ea (diff) | |
download | nbsh-a2462bbaea13f7a3f3eb65e7430b30618bc203b8.tar.gz nbsh-a2462bbaea13f7a3f3eb65e7430b30618bc203b8.zip |
move to tokio
Diffstat (limited to 'src/mutex.rs')
-rw-r--r-- | src/mutex.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mutex.rs b/src/mutex.rs index df28ffc..e49df9c 100644 --- a/src/mutex.rs +++ b/src/mutex.rs @@ -1,10 +1,10 @@ -pub type Mutex<T> = async_std::sync::Arc<async_std::sync::Mutex<T>>; -pub type Guard<T> = async_std::sync::MutexGuardArc<T>; +pub type Mutex<T> = std::sync::Arc<tokio::sync::Mutex<T>>; +pub type Guard<T> = tokio::sync::OwnedMutexGuard<T>; -pub fn new<T>(t: T) -> async_std::sync::Arc<async_std::sync::Mutex<T>> { - async_std::sync::Arc::new(async_std::sync::Mutex::new(t)) +pub fn new<T>(t: T) -> Mutex<T> { + std::sync::Arc::new(tokio::sync::Mutex::new(t)) } pub fn clone<T>(m: &Mutex<T>) -> Mutex<T> { - async_std::sync::Arc::clone(m) + std::sync::Arc::clone(m) } |