Files
tokio/tests/notify_both.rs
T

28 lines
691 B
Rust
Raw Normal View History

#![cfg(unix)]
extern crate libc;
2018-07-28 12:30:46 -07:00
pub mod support;
use support::*;
#[test]
fn notify_both() {
let mut lp = Core::new().unwrap();
let handle = lp.handle();
2018-07-28 12:30:46 -07:00
let signal1 = run_core_with_timeout(&mut lp, Signal::with_handle(
libc::SIGUSR2,
&handle.new_tokio_handle(),
2018-07-28 12:30:46 -07:00
)).expect("failed to create signal1");
let signal2 = run_core_with_timeout(&mut lp, Signal::with_handle(
libc::SIGUSR2,
&handle.new_tokio_handle(),
2018-07-28 12:30:46 -07:00
)).expect("failed to create signal2");
send_signal(libc::SIGUSR2);
run_core_with_timeout(&mut lp, signal1.into_future().join(signal2.into_future()))
.ok()
2018-07-28 12:30:46 -07:00
.expect("failed to create signal2");
}