Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
futures = { version = "0.3.31", default-features = false, optional = true }
futures-util = { version = "0.3.31", default-features = false, optional = true }
event-listener = { version = "5.4.1", default-features = false, optional = true }
local-event = { version = "0.1.1", default-features = false, optional = true }
see = { version = "0.1.1", optional = true }
slab = { version = "0.4.11", optional = true }

[features]
watch = ["dep:see"]
mutex = ["dep:futures", "dep:slab", "futures?/std"]
waker_slot = ["dep:futures"]
mutex = ["dep:slab"]
waker_slot = ["dep:futures-util"]
Comment thread
AsakuraMizu marked this conversation as resolved.
event = ["dep:event-listener", "dep:local-event"]
bilock = ["waker_slot"]

Expand Down
File renamed without changes.
17 changes: 2 additions & 15 deletions src/mutex/mod.rs → src/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ macro_rules! impl_mutex {
task::{Context, Poll},
};

use futures::future::FusedFuture;
use slab::Slab;

use super::*;
Expand Down Expand Up @@ -269,12 +268,6 @@ macro_rules! impl_mutex {
}
}

impl<T: ?Sized> FusedFuture for OwnedMutexLockFuture<T> {
fn is_terminated(&self) -> bool {
self.mutex.is_none()
}
}

impl<T: ?Sized> Future for OwnedMutexLockFuture<T> {
type Output = OwnedMutexGuard<T>;

Expand Down Expand Up @@ -389,12 +382,6 @@ macro_rules! impl_mutex {
}
}

impl<T: ?Sized> FusedFuture for MutexLockFuture<'_, T> {
fn is_terminated(&self) -> bool {
self.mutex.is_none()
}
}

impl<'a, T: ?Sized> Future for MutexLockFuture<'a, T> {
type Output = MutexGuard<'a, T>;

Expand Down Expand Up @@ -457,7 +444,7 @@ macro_rules! impl_mutex {
///
/// ```
/// # futures::executor::block_on(async {
/// use futures::lock::{Mutex, MutexGuard};
#[doc = concat!("use synchrony::", stringify!($sync), "::mutex::{Mutex, MutexGuard};")]
///
/// let data = Mutex::new(Some("value".to_string()));
/// {
Expand Down Expand Up @@ -529,7 +516,7 @@ macro_rules! impl_mutex {
///
/// ```
/// # futures::executor::block_on(async {
/// use futures::lock::{MappedMutexGuard, Mutex, MutexGuard};
#[doc = concat!("use synchrony::", stringify!($sync), "::mutex::{MappedMutexGuard, Mutex, MutexGuard};")]
///
/// let data = Mutex::new(Some("value".to_string()));
/// {
Expand Down
15 changes: 0 additions & 15 deletions src/mutex/unsync.rs

This file was deleted.

8 changes: 4 additions & 4 deletions src/waker_slot.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! A slot holds up to one waker for task wakeup.
//!
//! `sync` version is just [`futures::task::AtomicWaker`]; unsync version is a
//! hand-rolled singlethreaded version with similar API.
//! `sync` version is just [`futures_util::task::AtomicWaker`]; unsync version
//! is a hand-rolled singlethreaded version with similar API.

/// Multithreaded `WakerSlot` based on [`futures::task::AtomicWaker`].
/// Multithreaded `WakerSlot` based on [`futures_util::task::AtomicWaker`].
pub mod sync {
pub use futures::task::AtomicWaker as WakerSlot;
pub use futures_util::task::AtomicWaker as WakerSlot;

impl crate::AssertMt for WakerSlot {}
}
Expand Down