File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ use kv_log_macro::trace;
2121///
2222/// See also: [`task::blocking`].
2323///
24- /// [`task::blocking `]: fn.blocking .html
24+ /// [`task::spawn_blocking `]: fn.spawn_blocking .html
2525///
2626/// [spawning]: https://doc.rust-lang.org/std/thread/fn.spawn.html
2727/// [joining]: https://doc.rust-lang.org/std/thread/struct.JoinHandle.html#method.join
Original file line number Diff line number Diff line change @@ -60,9 +60,10 @@ cfg_if::cfg_if! {
6060/// is useful to prevent long-running synchronous operations from blocking the main futures
6161/// executor.
6262///
63- /// See also: [`task::block_on`].
63+ /// See also: [`task::block_on`], [`task::spawn`] .
6464///
6565/// [`task::block_on`]: fn.block_on.html
66+ /// [`task::spawn`]: fn.spawn.html
6667///
6768/// # Examples
6869///
@@ -73,7 +74,7 @@ cfg_if::cfg_if! {
7374/// #
7475/// use async_std::task;
7576///
76- /// task::blocking (|| {
77+ /// task::spawn_blocking (|| {
7778/// println!("long-running task here");
7879/// }).await;
7980/// #
@@ -84,10 +85,10 @@ cfg_if::cfg_if! {
8485#[ cfg( any( feature = "unstable" , feature = "docs" ) ) ]
8586#[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
8687#[ inline]
87- pub fn blocking < F , R > ( f : F ) -> task:: JoinHandle < R >
88+ pub fn spawn_blocking < F , R > ( f : F ) -> task:: JoinHandle < R >
8889where
8990 F : FnOnce ( ) -> R + Send + ' static ,
9091 R : Send + ' static ,
9192{
92- blocking:: spawn_blocking ( future )
93+ blocking:: spawn ( f )
9394}
You can’t perform that action at this time.
0 commit comments