Skip to content

Commit

Permalink
Revert "Move AtomicWaker from futures-core to futures-task"
Browse files Browse the repository at this point in the history
This reverts commit dd664a3.
  • Loading branch information
taiki-e committed Nov 5, 2019
1 parent 5cc1f42 commit 5325417
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 15 deletions.
5 changes: 2 additions & 3 deletions futures-channel/Cargo.toml
Expand Up @@ -23,12 +23,11 @@ sink = ["futures-sink-preview"]
# Unstable features
# These features are outside of the normal semver guarantees and require the
# `unstable` feature as an explicit opt-in to unstable API.
unstable = ["futures-core-preview/unstable", "futures-task-preview/unstable"]
cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic", "futures-task-preview/cfg-target-has-atomic"]
unstable = ["futures-core-preview/unstable"]
cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic"]

[dependencies]
futures-core-preview = { path = "../futures-core", version = "=0.3.0-alpha.19", default-features = false }
futures-task-preview = { path = "../futures-task", version = "=0.3.0-alpha.19", default-features = false }
futures-sink-preview = { path = "../futures-sink", version = "=0.3.0-alpha.19", default-features = false, optional = true }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion futures-channel/src/mpsc/mod.rs
Expand Up @@ -80,7 +80,7 @@

use futures_core::stream::{FusedStream, Stream};
use futures_core::task::{Context, Poll, Waker};
use futures_task::AtomicWaker;
use futures_core::task::__internal::AtomicWaker;
use std::fmt;
use std::pin::Pin;
use std::sync::{Arc, Mutex};
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions futures-core/src/task/__internal/mod.rs
@@ -0,0 +1,4 @@
#[cfg_attr(feature = "cfg-target-has-atomic", cfg(target_has_atomic = "ptr"))]
mod atomic_waker;
#[cfg_attr(feature = "cfg-target-has-atomic", cfg(target_has_atomic = "ptr"))]
pub use self::atomic_waker::AtomicWaker;
9 changes: 9 additions & 0 deletions futures-core/src/task/mod.rs
@@ -0,0 +1,9 @@
//! Task notification.

#[macro_use]
mod poll;

#[doc(hidden)]
pub mod __internal;

pub use core::task::{Context, Poll, Waker, RawWaker, RawWakerVTable};
4 changes: 0 additions & 4 deletions futures-core/src/task.rs → futures-core/src/task/poll.rs
@@ -1,7 +1,3 @@
//! Task notification.

pub use core::task::{Context, Poll, Waker, RawWaker, RawWakerVTable};

/// Extracts the successful type of a `Poll<T>`.
///
/// This macro bakes in propagation of `Pending` signals by returning early.
Expand Down
5 changes: 0 additions & 5 deletions futures-task/src/lib.rs
Expand Up @@ -30,11 +30,6 @@ mod spawn;
pub use crate::spawn::{Spawn, SpawnError, LocalSpawn};

cfg_target_has_atomic! {
#[cfg_attr(feature = "cfg-target-has-atomic", cfg(target_has_atomic = "ptr"))]
mod atomic_waker;
#[cfg_attr(feature = "cfg-target-has-atomic", cfg(target_has_atomic = "ptr"))]
pub use crate::atomic_waker::AtomicWaker;

#[cfg(feature = "alloc")]
mod arc_wake;
#[cfg(feature = "alloc")]
Expand Down
3 changes: 2 additions & 1 deletion futures-util/src/stream/futures_unordered/mod.rs
Expand Up @@ -6,7 +6,8 @@
use futures_core::future::Future;
use futures_core::stream::{FusedStream, Stream};
use futures_core::task::{Context, Poll};
use futures_task::{FutureObj, LocalFutureObj, AtomicWaker, Spawn, LocalSpawn, SpawnError};
use futures_task::{FutureObj, LocalFutureObj, Spawn, LocalSpawn, SpawnError};
use crate::task::AtomicWaker;
use core::cell::UnsafeCell;
use core::fmt::{self, Debug};
use core::iter::FromIterator;
Expand Down
2 changes: 1 addition & 1 deletion futures-util/src/task/mod.rs
Expand Up @@ -10,7 +10,7 @@ cfg_target_has_atomic! {
#[cfg(feature = "alloc")]
pub use futures_task::{waker_ref, WakerRef};

pub use futures_task::AtomicWaker;
pub use futures_core::task::__internal::AtomicWaker;
}

mod spawn;
Expand Down

0 comments on commit 5325417

Please sign in to comment.