Skip to content

Commit

Permalink
time: document Interval::tick cancel safety (tokio-rs#4152)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn authored and Oliver Giersch committed Oct 28, 2021
1 parent 715c1ca commit 59f5147
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tokio/src/time/interval.rs
Expand Up @@ -367,6 +367,11 @@ pub struct Interval {
impl Interval {
/// Completes when the next instant in the interval has been reached.
///
/// # Cancel safety
///
/// This method is cancellation safe. If `tick` is used as the branch in a `tokio::select!` and
/// another branch completes first, then no tick has been consumed.
///
/// # Examples
///
/// ```
Expand Down

0 comments on commit 59f5147

Please sign in to comment.