mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +00:00

This renames the SignalKind constructors to be a bit more readable instead of using the signal names themselves
24 lines
461 B
Rust
24 lines
461 B
Rust
#![cfg(unix)]
|
|
#![warn(rust_2018_idioms)]
|
|
#![feature(async_await)]
|
|
|
|
pub mod support;
|
|
use crate::support::*;
|
|
|
|
use libc;
|
|
|
|
#[tokio::test]
|
|
async fn twice() {
|
|
let kind = SignalKind::user_defined1();
|
|
let mut signal = Signal::new(kind).expect("failed to get signal");
|
|
|
|
for _ in 0..2 {
|
|
send_signal(libc::SIGUSR1);
|
|
|
|
let (item, sig) = with_timeout(signal.into_future()).await;
|
|
assert_eq!(item, Some(()));
|
|
|
|
signal = sig;
|
|
}
|
|
}
|