1 #![warn(rust_2018_idioms)]
2 #![cfg(feature = "full")]
3 #![cfg(unix)]
4 
5 mod support {
6     pub mod signal;
7 }
8 use support::signal::send_signal;
9 
10 use tokio::signal::unix::{signal, SignalKind};
11 
12 #[tokio::test]
drop_then_get_a_signal()13 async fn drop_then_get_a_signal() {
14     let kind = SignalKind::user_defined1();
15     let sig = signal(kind).expect("failed to create first signal");
16     drop(sig);
17 
18     send_signal(libc::SIGUSR1);
19     let mut sig = signal(kind).expect("failed to create second signal");
20 
21     let _ = sig.recv().await;
22 }
23