mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-07 00:00:09 +02:00
Migrate to std::futures and the futures 0.3 preview and use async/await where possible **Breaking change:** the IoFuture and IoStream definitions used to refer to Box<dyn Future> and Box<dyn Stream>, but now they are defined as Pin<...> versions which are technically breaking. No other breaking or functional changes have been made
31 lines
906 B
Rust
31 lines
906 B
Rust
#![cfg(unix)]
|
|
#![deny(warnings, rust_2018_idioms)]
|
|
#![feature(async_await)]
|
|
|
|
use libc;
|
|
|
|
pub mod support;
|
|
use crate::support::*;
|
|
|
|
const TEST_SIGNAL: libc::c_int = libc::SIGUSR1;
|
|
|
|
#[tokio::test]
|
|
async fn dropping_signal_does_not_deregister_any_other_instances() {
|
|
// NB: Testing for issue #38: signals should not starve based on ordering
|
|
let first_duplicate_signal = with_timeout(Signal::new(TEST_SIGNAL))
|
|
.await
|
|
.expect("failed to register first duplicate signal");
|
|
let signal = with_timeout(Signal::new(TEST_SIGNAL))
|
|
.await
|
|
.expect("failed to register signal");
|
|
let second_duplicate_signal = with_timeout(Signal::new(TEST_SIGNAL))
|
|
.await
|
|
.expect("failed to register second duplicate signal");
|
|
|
|
drop(first_duplicate_signal);
|
|
drop(second_duplicate_signal);
|
|
|
|
send_signal(TEST_SIGNAL);
|
|
with_timeout(signal.into_future()).await;
|
|
}
|