From 2b1892a47ee877be7576e669f3d1b0eb04d48a2f Mon Sep 17 00:00:00 2001 From: jack Date: Mon, 29 Jun 2015 07:47:13 +0200 Subject: [PATCH] signals: Don't block GC suspend/resume signals on interrupt thread Blocking all signals except default interrupt caused OpenBSD broken multithread builds, because of GC semaphore lockup waiting, untill all threads are stopped. Fixes #71. Signed-off-by: jack --- CHANGELOG | 2 ++ src/c/unixint.d | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index adbad3e9d..615815682 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -41,6 +41,8 @@ - Duplicate large block deallocation with GMP 6.0.0a fixed + - ECL builds on OpenBSD with threads enabled + - Other minor tweaks ** Enchantments: diff --git a/src/c/unixint.d b/src/c/unixint.d index 5b69f6969..5eaa7f9c7 100644 --- a/src/c/unixint.d +++ b/src/c/unixint.d @@ -30,7 +30,7 @@ * them (synchronous signals), such as floating point exceptions, or * extrinsic (asynchronous signals), such as the process being aborted * by the user. - * + * * Of course, those interruptions are not always welcome. When the * interrupt is delivered and a handler is invoked, the thread or even * the whole program may be in an inconsistent state. For instance the @@ -526,7 +526,7 @@ asynchronous_signal_servicing_thread() const cl_env_ptr the_env = ecl_process_env(); int interrupt_signal = -1; /* - * We block all signals except the usual interrupt thread. + * We block all signals except the usual interrupt thread and GC signals. */ { sigset_t handled_set; @@ -535,6 +535,8 @@ asynchronous_signal_servicing_thread() interrupt_signal = ecl_option_values[ECL_OPT_THREAD_INTERRUPT_SIGNAL]; sigdelset(&handled_set, interrupt_signal); + sigdelset(&handled_set, GC_get_suspend_signal()); + sigdelset(&handled_set, GC_get_thr_restart_signal()); } pthread_sigmask(SIG_BLOCK, &handled_set, NULL); }