Files
tokio/tokio-signal/tests/notify_both.rs
T
Ivan Petkov 461eebe612 signal: Replace ctrl_c with a CtrlC struct (#1273)
* Add a new `CtrlC` struct which will represent a stream of SIGINT
signals on Unix or the CTRL_C event on Windows
* `CtrlC` implements `Stream<Output = ()>` rather than `IoSteam` as
previously
2019-07-09 08:48:46 -07:00

23 lines
535 B
Rust

#![cfg(unix)]
#![deny(warnings, rust_2018_idioms)]
#![feature(async_await)]
pub mod support;
use crate::support::*;
use libc;
#[tokio::test]
async fn notify_both() {
let signal1 = with_timeout(Signal::new(libc::SIGUSR2))
.await
.expect("failed to create signal1");
let signal2 = with_timeout(Signal::new(libc::SIGUSR2))
.await
.expect("failed to create signal2");
send_signal(libc::SIGUSR2);
let _ = with_timeout(future::join(signal1.into_future(), signal2.into_future())).await;
}