Files
tokio/tokio-signal/tests/drop_then_get_a_signal.rs
T
Ivan Petkov 461eebe612 signal: Replace ctrl_c with a CtrlC struct (#1273)
* Add a new `CtrlC` struct which will represent a stream of SIGINT
signals on Unix or the CTRL_C event on Windows
* `CtrlC` implements `Stream<Output = ()>` rather than `IoSteam` as
previously
2019-07-09 08:48:46 -07:00

24 lines
535 B
Rust

#![cfg(unix)]
#![deny(warnings, 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 = with_timeout(Signal::new(libc::SIGUSR1))
.await
.expect("failed to create first signal");
drop(signal);
send_signal(libc::SIGUSR1);
let signal = with_timeout(Signal::new(libc::SIGUSR1))
.await
.expect("failed to create second signal");
let _ = with_timeout(signal.into_future()).await;
}