Files
tokio/tokio/tests/signal_notify_both.rs
T
Carl Lerche 227533d456 net: move into tokio crate (#1683)
A step towards collapsing Tokio sub crates into a single `tokio`
crate (#1318).

The `net` implementation is now provided by the main `tokio` crate.
Functionality can be opted out of by using the various net related
feature flags.
2019-10-25 12:50:15 -07:00

24 lines
538 B
Rust

#![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;
}