Skip to content

Commit c56b6a1

Browse files
authoredJun 2, 2022
Merge pull request #1017 from joshtriplett/stabilize-spawn-blocking
Stabilize `std::task::spawn_blocking`
2 parents d15a221 + 07ba24c commit c56b6a1

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed
 

‎CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://book.async.rs/overview
88
# [Unreleased]
99

1010
## Added
11+
12+
- `std::task_spawn_blocking` is now stabilized. We consider it a fundamental API for bridging between blocking code and async code, and we widely use it within async-std's own implementation.
13+
1114
## Removed
1215
## Changed
1316

‎src/task/mod.rs

-4
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,7 @@ cfg_default! {
160160
mod task_locals_wrapper;
161161

162162
#[cfg(not(target_os = "unknown"))]
163-
#[cfg(any(feature = "unstable", test))]
164163
pub use spawn_blocking::spawn_blocking;
165-
#[cfg(not(target_os = "unknown"))]
166-
#[cfg(not(any(feature = "unstable", test)))]
167-
pub(crate) use spawn_blocking::spawn_blocking;
168164
}
169165

170166
cfg_unstable! {

‎src/task/spawn_blocking.rs

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use crate::task::{self, JoinHandle};
1616
/// Basic usage:
1717
///
1818
/// ```
19-
/// # #[cfg(feature = "unstable")]
2019
/// # async_std::task::block_on(async {
2120
/// #
2221
/// use async_std::task;
@@ -28,7 +27,6 @@ use crate::task::{self, JoinHandle};
2827
/// #
2928
/// # })
3029
/// ```
31-
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
3230
#[inline]
3331
pub fn spawn_blocking<F, T>(f: F) -> JoinHandle<T>
3432
where

0 commit comments

Comments
 (0)
Please sign in to comment.