Skip to content

Commit

Permalink
feat: use async-lock for RwLock and Barrier
Browse files Browse the repository at this point in the history
  • Loading branch information
Kestrer committed Jan 13, 2021
1 parent 1184a7f commit 4a3f963
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 718 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ std = [
"slab",
"wasm-bindgen-futures",
"futures-channel",
"async-mutex",
"async-channel",
"async-lock",
]
alloc = [
"futures-core/alloc",
Expand All @@ -64,7 +64,7 @@ tokio03 = ["async-global-executor/tokio03"]

[dependencies]
async-attributes = { version = "1.1.1", optional = true }
async-mutex = { version = "1.1.3", optional = true }
async-lock = { version = "2.3.0", optional = true }
crossbeam-utils = { version = "0.8.0", optional = true }
futures-core = { version = "0.3.4", optional = true, default-features = false }
futures-io = { version = "0.3.4", optional = true }
Expand Down
229 changes: 0 additions & 229 deletions src/sync/barrier.rs

This file was deleted.

16 changes: 7 additions & 9 deletions src/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,22 +177,20 @@
pub use std::sync::{Arc, Weak};

#[doc(inline)]
pub use async_mutex::{Mutex, MutexGuard};
pub use async_lock::{Mutex, MutexGuard, MutexGuardArc};

pub use rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard};

mod rwlock;
#[doc(inline)]
pub use async_lock::{RwLock, RwLockReadGuard, RwLockUpgradableReadGuard, RwLockWriteGuard};

cfg_unstable! {
pub use barrier::{Barrier, BarrierWaitResult};
pub use async_lock::{Barrier, BarrierWaitResult};
#[allow(deprecated)]
pub use channel::{channel, Sender, Receiver, RecvError, TryRecvError, TrySendError};
pub use condvar::Condvar;
pub(crate) use waker_set::WakerSet;

mod barrier;
mod condvar;
mod channel;
}

pub(crate) mod waker_set;
pub(crate) use waker_set::WakerSet;
pub(crate) mod waker_set;
}

0 comments on commit 4a3f963

Please sign in to comment.