mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +00:00
22 lines
438 B
Rust
22 lines
438 B
Rust
#![cfg(unix)]
|
|
#![cfg(feature = "signal")]
|
|
#![warn(rust_2018_idioms)]
|
|
|
|
mod support;
|
|
use 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;
|
|
}
|
|
}
|