mirror of
https://github.com/async-rs/async-std.git
synced 2025-04-09 09:56:42 +00:00
Merge pull request #514 from async-rs/stabilize-yield-now
stabilize task::yield_now
This commit is contained in:
commit
46c58b214c
2 changed files with 3 additions and 7 deletions
|
@ -124,6 +124,9 @@ cfg_std! {
|
||||||
|
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use async_macros::ready;
|
pub use async_macros::ready;
|
||||||
|
|
||||||
|
pub use yield_now::yield_now;
|
||||||
|
mod yield_now;
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg_default! {
|
cfg_default! {
|
||||||
|
@ -157,8 +160,3 @@ cfg_default! {
|
||||||
#[cfg(not(any(feature = "unstable", test)))]
|
#[cfg(not(any(feature = "unstable", test)))]
|
||||||
pub(crate) use spawn_blocking::spawn_blocking;
|
pub(crate) use spawn_blocking::spawn_blocking;
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg_unstable! {
|
|
||||||
pub use yield_now::yield_now;
|
|
||||||
mod yield_now;
|
|
||||||
}
|
|
||||||
|
|
|
@ -26,8 +26,6 @@ use crate::task::{Context, Poll};
|
||||||
/// #
|
/// #
|
||||||
/// # })
|
/// # })
|
||||||
/// ```
|
/// ```
|
||||||
#[cfg(feature = "unstable")]
|
|
||||||
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub async fn yield_now() {
|
pub async fn yield_now() {
|
||||||
YieldNow(false).await
|
YieldNow(false).await
|
||||||
|
|
Loading…
Reference in a new issue