summaryrefslogtreecommitdiffstats
path: root/tokio-signal/tests/drop_then_get_a_signal.rs
blob: 0573d6b9d4a786197a82e2782f5498d1e2eb90fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#![cfg(unix)]
#![warn(rust_2018_idioms)]
#![feature(async_await)]

use libc;

pub mod support;
use crate::support::*;

#[tokio::test]
async fn drop_then_get_a_signal() {
    let signal = Signal::new(libc::SIGUSR1).expect("failed to create first signal");
    drop(signal);

    send_signal(libc::SIGUSR1);
    let signal = Signal::new(libc::SIGUSR1).expect("failed to create second signal");

    let _ = with_timeout(signal.into_future()).await;
}