2018-07-15 20:22:34 -07:00
|
|
|
#![cfg(unix)]
|
2019-05-14 10:27:36 -07:00
|
|
|
#![deny(warnings, rust_2018_idioms)]
|
2018-07-15 20:22:34 -07:00
|
|
|
|
2018-07-28 12:30:46 -07:00
|
|
|
pub mod support;
|
2019-05-14 10:27:36 -07:00
|
|
|
use crate::support::*;
|
|
|
|
|
|
|
|
|
|
use libc;
|
2018-07-15 20:22:34 -07:00
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn notify_both() {
|
2018-09-02 11:32:50 +02:00
|
|
|
let mut rt = CurrentThreadRuntime::new().unwrap();
|
2019-02-21 11:56:15 -08:00
|
|
|
let signal1 =
|
|
|
|
|
run_with_timeout(&mut rt, Signal::new(libc::SIGUSR2)).expect("failed to create signal1");
|
2018-07-28 12:30:46 -07:00
|
|
|
|
2019-02-21 11:56:15 -08:00
|
|
|
let signal2 =
|
|
|
|
|
run_with_timeout(&mut rt, Signal::new(libc::SIGUSR2)).expect("failed to create signal2");
|
2018-07-28 12:30:46 -07:00
|
|
|
|
|
|
|
|
send_signal(libc::SIGUSR2);
|
2018-09-02 11:32:50 +02:00
|
|
|
run_with_timeout(&mut rt, signal1.into_future().join(signal2.into_future()))
|
2018-07-15 20:22:34 -07:00
|
|
|
.ok()
|
2018-09-02 11:32:50 +02:00
|
|
|
.expect("failed to receive");
|
2018-07-15 20:22:34 -07:00
|
|
|
}
|