docs: Signal::recv is cancel-safe (#4634)

This commit is contained in:
Aleksey Kladov
2022-04-23 09:12:24 +00:00
committed by GitHub
parent 1472af5bd4
commit b4d82c3e70
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -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`
+6
View File
@@ -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 no signal is lost.
///
/// # Examples
///
/// Wait for SIGHUP