summaryrefslogtreecommitdiffstats
path: root/tokio/tests/signal_notify_both.rs
blob: 00385478660c5c46bd1e2c1edac177cff6ac9aa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
}