From e0100efe51654dc8fc95ea769140591a8f230b79 Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Sat, 11 Oct 2008 20:19:51 +0200 Subject: [PATCH] Interrupts have to be explicitely activated at the thread entry point. --- src/c/main.d | 9 +++++++++ src/c/threads.d | 1 + 2 files changed, 10 insertions(+) diff --git a/src/c/main.d b/src/c/main.d index b91f3ef6b..ca1ba5bd6 100644 --- a/src/c/main.d +++ b/src/c/main.d @@ -202,6 +202,11 @@ static const struct { cl_env_ptr _ecl_alloc_env() { + /* + * Allocates the lisp environment for a thread. Depending on which + * mechanism we use for detecting delayed signals, we may allocate + * the environment using mmap or the garbage collector. + */ cl_env_ptr output; #if defined(ECL_USE_MPROTECT) output = mmap(0, sizeof(*output), PROT_READ | PROT_WRITE, @@ -211,6 +216,10 @@ _ecl_alloc_env() #else output = ecl_alloc(sizeof(*output)); #endif + /* + * An uninitialized environment _always_ disables interrupts. They + * are activated later on by the thread entry point or init_unixint(). + */ output->disable_interrupts = 1; return output; } diff --git a/src/c/threads.d b/src/c/threads.d index aa9f6149a..dbcab8d7d 100644 --- a/src/c/threads.d +++ b/src/c/threads.d @@ -134,6 +134,7 @@ thread_entry_point(cl_object process) ecl_init_env(env); init_big_registers(env); ecl_set_process_env(env); + ecl_enable_interrupts(env); /* 2) Execute the code. The CATCH_ALL point is the destination * provides us with an elegant way to exit the thread: we just