summaryrefslogtreecommitdiffstats
path: root/vendor/tokio/tests/signal_notify_both.rs
blob: 3481f808b36df1008d30f433dbacbfc468a01cfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#![warn(rust_2018_idioms)]
#![cfg(feature = "full")]
#![cfg(unix)]

mod support {
    pub mod signal;
}
use support::signal::send_signal;

use tokio::signal::unix::{signal, SignalKind};

#[tokio::test]
async fn notify_both() {
    let kind = SignalKind::user_defined2();

    let mut signal1 = signal(kind).expect("failed to create signal1");
    let mut signal2 = signal(kind).expect("failed to create signal2");

    send_signal(libc::SIGUSR2);

    signal1.recv().await;
    signal2.recv().await;
}