From 3bbba10703560387523df4e40885b5b85303057d Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Wed, 11 Apr 2012 21:58:05 +0200 Subject: [PATCH] Block interrupts when exiting the thread. --- src/c/threads/process.d | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/c/threads/process.d b/src/c/threads/process.d index 37e2d6713..4bbb0c804 100644 --- a/src/c/threads/process.d +++ b/src/c/threads/process.d @@ -196,6 +196,14 @@ thread_cleanup(void *aux) */ cl_object process = (cl_object)aux; cl_env_ptr env = process->process.env; +#ifdef HAVE_SIGPROCMASK + /* No signals from here on */ + { + sigset_t new[1]; + sigaddset(new, ecl_option_values[ECL_OPT_SIGNAL_HANDLING_THREAD]); + pthread_sigmask(SIG_BLOCK, new, NULL); + } +#endif /* The following flags will disable all interrupts. */ AO_store((AO_t*)&process->process.phase, ECL_PROCESS_EXITING); ecl_unlist_process(process);