mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00

* Also removed any `*_with_handle` related methods in favor of always using the default reactor
23 lines
488 B
Rust
23 lines
488 B
Rust
#![cfg(unix)]
|
|
#![cfg(feature = "signal")]
|
|
#![warn(rust_2018_idioms)]
|
|
#![feature(async_await)]
|
|
|
|
pub mod signal_support;
|
|
use crate::signal_support::*;
|
|
|
|
#[tokio::test]
|
|
async fn twice() {
|
|
let kind = SignalKind::user_defined1();
|
|
let mut sig = signal(kind).expect("failed to get signal");
|
|
|
|
for _ in 0..2 {
|
|
send_signal(libc::SIGUSR1);
|
|
|
|
let (item, sig_next) = with_timeout(sig.into_future()).await;
|
|
assert_eq!(item, Some(()));
|
|
|
|
sig = sig_next;
|
|
}
|
|
}
|