mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-06 00:00:10 +02:00
This renames the SignalKind constructors to be a bit more readable instead of using the signal names themselves
18 lines
337 B
Rust
18 lines
337 B
Rust
#![cfg(unix)]
|
|
#![warn(rust_2018_idioms)]
|
|
#![feature(async_await)]
|
|
|
|
pub mod support;
|
|
use crate::support::*;
|
|
|
|
use libc;
|
|
|
|
#[tokio::test]
|
|
async fn simple() {
|
|
let signal = Signal::new(SignalKind::user_defined1()).expect("failed to create signal");
|
|
|
|
send_signal(libc::SIGUSR1);
|
|
|
|
let _ = with_timeout(signal.into_future()).await;
|
|
}
|