mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-29 00:00:11 +02:00
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.
24 lines
538 B
Rust
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;
|
|
}
|