thread_sigmask(SIG_SETMASK,&new,0);
}
-void block_deferrable_signals_and_inhibit_gc ()
-{
- struct thread *thread=arch_os_get_current_thread();
- sigset_t block;
- sigemptyset(&block);
- sigaddset_deferrable(&block);
- thread_sigmask(SIG_BLOCK, &block, 0);
- bind_variable(GC_INHIBIT,T,thread);
-}
-
-static void block_blockable_signals ()
+void block_blockable_signals ()
{
sigset_t block;
sigemptyset(&block);
#ifdef LISP_FEATURE_LINUX
os_restore_fp_control(context);
#endif
- if(maybe_defer_handler(interrupt_handle_now,data,
- signal,info,context))
+ if(maybe_defer_handler(interrupt_handle_now,data,signal,info,context))
return;
interrupt_handle_now(signal, info, context);
#ifdef LISP_FEATURE_DARWIN
{
os_context_t *context = (os_context_t*)void_context;
struct thread *thread=arch_os_get_current_thread();
+ struct interrupt_data *data=thread->interrupt_data;
#ifdef LISP_FEATURE_LINUX
os_restore_fp_control(context);
#endif
check_blockables_blocked_or_lose();
check_interrupts_enabled_or_lose(context);
- (*thread->interrupt_data->interrupt_low_level_handlers[signal])
+ (*data->interrupt_low_level_handlers[signal])
(signal, info, void_context);
#ifdef LISP_FEATURE_DARWIN
/* Work around G5 bug */
* thread interrupt execution is undefined. */
struct thread *th=arch_os_get_current_thread();
struct cons *c;
+ lispobj function;
if (th->state != STATE_RUNNING)
- lose("interrupt_thread_handler: thread %ld in wrong state: %d\n",
+ lose("interrupt_thread_handler: thread %lu in wrong state: %d\n",
th->os_thread,fixnum_value(th->state));
get_spinlock(&th->interrupt_fun_lock,(long)th);
c=((struct cons *)native_pointer(th->interrupt_fun));
- arrange_return_to_lisp_function(context,c->car);
+ function=c->car;
th->interrupt_fun=c->cdr;
release_spinlock(&th->interrupt_fun_lock);
+ if (function==NIL)
+ lose("interrupt_thread_handler: NIL function\n");
+ arrange_return_to_lisp_function(context,function);
}
#endif
{
os_context_t *context=(os_context_t *) void_context;
struct thread *th=arch_os_get_current_thread();
- struct interrupt_data *data=
- th ? th->interrupt_data : global_interrupt_data;
+ struct interrupt_data *data=th->interrupt_data;
if(!foreign_function_call_active && gc_trigger_hit(signal, info, context)){
struct thread *thread=arch_os_get_current_thread();
{
struct sigaction sa;
struct thread *th=arch_os_get_current_thread();
+ /* It may be before the initial thread is started. */
struct interrupt_data *data=
th ? th->interrupt_data : global_interrupt_data;
sigset_t old, new;
union interrupt_handler oldhandler;
struct thread *th=arch_os_get_current_thread();
+ /* It may be before the initial thread is started. */
struct interrupt_data *data=
th ? th->interrupt_data : global_interrupt_data;