From 10dcd5d0da23ca2ceaba373cc7c366f80587516f Mon Sep 17 00:00:00 2001 From: Chris Green Date: Mon, 27 Nov 2023 11:42:56 -0600 Subject: [PATCH] Reenable RT signals after custom signal handler is installed --- art/Utilities/UnixSignalHandlers.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/art/Utilities/UnixSignalHandlers.cc b/art/Utilities/UnixSignalHandlers.cc index e9fd69ff9..4ffba808e 100644 --- a/art/Utilities/UnixSignalHandlers.cc +++ b/art/Utilities/UnixSignalHandlers.cc @@ -76,7 +76,7 @@ namespace art { #ifdef __linux__ void - disableRTSigs() + tweakRTSigs_(int how) { sigset_t myset; abort_on_error(sigemptyset(&myset)); @@ -87,7 +87,7 @@ namespace art { abort_on_error(sigaddset(&myset, num)); abort_on_error(sigaction(num, &tmpact, nullptr)); } - abort_on_error(pthread_sigmask(SIG_BLOCK, &myset, 0)); + abort_on_error(pthread_sigmask(how, &myset, 0)); } #endif // __linux__ @@ -105,9 +105,12 @@ namespace art { sigset_t oldset; disableAllSigs(&oldset); #ifdef __linux__ - disableRTSigs(); + tweakRTSigs_(SIG_BLOCK); #endif // __linux__ installSig(signum, func); +#ifdef __linux__ + tweakRTSigs_(SIG_UNBLOCK); +#endif // __linux__ reenableSigs(&oldset); }