Skip to content

Commit

Permalink
preemption: block_on future also cedes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhoo committed Jan 23, 2020
1 parent 98ce984 commit 8fafbc6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tokio/src/runtime/basic_scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ where
return v;
}

crate::league::ceded();

scheduler.tick(local);

// Maintenance work
Expand Down
2 changes: 2 additions & 0 deletions tokio/src/runtime/enter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ cfg_blocking_impl! {
return Ok(v);
}

crate::league::ceded();

park.park()?;
}
}
Expand Down
2 changes: 2 additions & 0 deletions tokio/src/runtime/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ impl Shell {
return v;
}

crate::league::ceded();

self.driver.park().unwrap();
}
}
Expand Down

0 comments on commit 8fafbc6

Please sign in to comment.