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 ] |
13 | async fn notify_both() { |
14 | let kind = SignalKind::user_defined2(); |
15 | |
16 | let mut signal1 = signal(kind).expect("failed to create signal1" ); |
17 | let mut signal2 = signal(kind).expect("failed to create signal2" ); |
18 | |
19 | send_signal(libc::SIGUSR2); |
20 | |
21 | signal1.recv().await; |
22 | signal2.recv().await; |
23 | } |
24 | |