From a1d0681cd2e581b1f6767126858d2f3d5d8992f5 Mon Sep 17 00:00:00 2001 From: Ivan Petkov Date: Thu, 24 Sep 2020 10:51:46 -0700 Subject: process: do not publicly turn on `signal` when enabled (#2871) This change will still internally compile any `signal` resources required when `process` is enabled on unix systems, but it will not publicly turn on the cargo feature --- tokio/src/runtime/context.rs | 2 +- tokio/src/runtime/driver.rs | 22 +++++----------------- 2 files changed, 6 insertions(+), 18 deletions(-) (limited to 'tokio/src/runtime') diff --git a/tokio/src/runtime/context.rs b/tokio/src/runtime/context.rs index 7498175f..a4f88e90 100644 --- a/tokio/src/runtime/context.rs +++ b/tokio/src/runtime/context.rs @@ -22,7 +22,7 @@ cfg_io_driver! { } } -cfg_signal! { +cfg_signal_internal! { #[cfg(unix)] pub(crate) fn signal_handle() -> crate::runtime::driver::SignalHandle { CONTEXT.with(|ctx| match *ctx.borrow() { diff --git a/tokio/src/runtime/driver.rs b/tokio/src/runtime/driver.rs index 2ea50890..148e0b16 100644 --- a/tokio/src/runtime/driver.rs +++ b/tokio/src/runtime/driver.rs @@ -38,26 +38,14 @@ cfg_not_io_driver! { } // ===== signal driver ===== - -macro_rules! cfg_unix_and_signal { - ($($item:item)*) => { - $( - #[cfg(all(not(loom), unix, feature = "signal"))] - $item - )* - } -} - -macro_rules! cfg_neither_unix_nor_windows { +macro_rules! cfg_signal_internal_and_unix { ($($item:item)*) => { - $( - #[cfg(any(loom, not(all(unix, feature = "signal"))))] - $item - )* + #[cfg(unix)] + cfg_signal_internal! { $($item)* } } } -cfg_unix_and_signal! { +cfg_signal_internal_and_unix! { type SignalDriver = crate::park::Either; pub(crate) type SignalHandle = Option; @@ -76,7 +64,7 @@ cfg_unix_and_signal! { } } -cfg_neither_unix_nor_windows! { +cfg_not_signal_internal! { type SignalDriver = IoDriver; pub(crate) type SignalHandle = (); -- cgit v1.2.3