Skip to content

Commit

Permalink
docs: Signal::recv is cancel-safe
Browse files Browse the repository at this point in the history
  • Loading branch information
matklad committed Apr 22, 2022
1 parent 1472af5 commit d6e4aaa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions tokio/src/macros/select.rs
Expand Up @@ -101,6 +101,7 @@
/// * [`tokio::sync::watch::Receiver::changed`](crate::sync::watch::Receiver::changed)
/// * [`tokio::net::TcpListener::accept`](crate::net::TcpListener::accept)
/// * [`tokio::net::UnixListener::accept`](crate::net::UnixListener::accept)
/// * [`tokio::signal::unix::Signal::recv`](crate::signal::unix::Signal::recv)
/// * [`tokio::io::AsyncReadExt::read`](crate::io::AsyncReadExt::read) on any `AsyncRead`
/// * [`tokio::io::AsyncReadExt::read_buf`](crate::io::AsyncReadExt::read_buf) on any `AsyncRead`
/// * [`tokio::io::AsyncWriteExt::write`](crate::io::AsyncWriteExt::write) on any `AsyncWrite`
Expand Down
6 changes: 6 additions & 0 deletions tokio/src/signal/unix.rs
Expand Up @@ -407,6 +407,12 @@ impl Signal {
///
/// `None` is returned if no more events can be received by this stream.
///
/// # Cancel safety
///
/// This method is cancel safe. If you use it as the event in a
/// [`tokio::select!`](crate::select) statement and some other branch
/// completes first, then it is guaranteed that signal is not lost.
///
/// # Examples
///
/// Wait for SIGHUP
Expand Down

0 comments on commit d6e4aaa

Please sign in to comment.