diff options
Diffstat (limited to 'tokio/tests/signal_notify_both.rs')
-rw-r--r-- | tokio/tests/signal_notify_both.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tokio/tests/signal_notify_both.rs b/tokio/tests/signal_notify_both.rs new file mode 100644 index 00000000..00385478 --- /dev/null +++ b/tokio/tests/signal_notify_both.rs @@ -0,0 +1,23 @@ +#![cfg(unix)] +#![warn(rust_2018_idioms)] + +mod support { + pub mod signal; +} +use support::signal::send_signal; + +use tokio::prelude::*; +use tokio::signal::unix::{signal, SignalKind}; + +use futures::future; + +#[tokio::test] +async fn notify_both() { + let kind = SignalKind::user_defined2(); + let signal1 = signal(kind).expect("failed to create signal1"); + + let signal2 = signal(kind).expect("failed to create signal2"); + + send_signal(libc::SIGUSR2); + let _ = future::join(signal1.into_future(), signal2.into_future()).await; +} |