Skip to content

Commit

Permalink
fix current_thread runtime error
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkyPotato committed Mar 15, 2023
1 parent fd2b09e commit befccf0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tokio/src/runtime/task/join.rs
Expand Up @@ -182,8 +182,8 @@ impl<T> JoinHandle<T> {
/// ```rust
/// use tokio::time;
///
/// #[tokio::main]
/// async fn main() {
/// # #[tokio::main(flavor = "current_thread")]
/// # async fn main() {
/// # tokio::time::pause();
/// let mut handles = Vec::new();
///
Expand All @@ -204,7 +204,7 @@ impl<T> JoinHandle<T> {
/// for handle in handles {
/// assert!(handle.await.unwrap_err().is_cancelled());
/// }
/// }
/// # }
/// ```
/// [cancelled]: method@super::error::JoinError::is_cancelled
pub fn abort(&self) {
Expand Down Expand Up @@ -261,9 +261,9 @@ impl<T> JoinHandle<T> {
/// ```rust
/// use tokio::{time, task};
///
/// #[tokio::main]
/// async fn main() {
/// # tokio::time::pause();
/// # #[tokio::main(flavor = "current_thread")]
/// # async fn main() {
/// # time::pause();
/// let mut handles = Vec::new();
///
/// handles.push(tokio::spawn(async {
Expand All @@ -285,7 +285,7 @@ impl<T> JoinHandle<T> {
/// for handle in handles {
/// assert!(handle.await.unwrap_err().is_cancelled());
/// }
/// }
/// # }
/// ```
/// [cancelled]: method@super::error::JoinError::is_cancelled
pub fn abort_handle(&self) -> super::AbortHandle {
Expand Down

0 comments on commit befccf0

Please sign in to comment.