* mask ought to be clear anyway most of the time, but may be non-zero
* if we were interrupted e.g. while waiting for a queue. */
-#if 1
void reset_signal_mask ()
{
sigset_t new;
sigemptyset(&new);
sigprocmask(SIG_SETMASK,&new,0);
}
-#else
-void reset_signal_mask ()
-{
- sigset_t new,old;
- int i;
- int wrong=0;
- sigemptyset(&new);
- sigprocmask(SIG_SETMASK,&new,&old);
- for(i=1; i<NSIG; i++) {
- if(sigismember(&old,i)) {
- fprintf(stderr,
- "Warning: signal %d is masked: this is unexpected\n",i);
- wrong=1;
- }
- }
- if(wrong)
- fprintf(stderr,"If this version of SBCL is less than three months old, please report this.\nOtherwise, please try a newer version first\n. Reset signal mask.\n");
-}
-#endif
#ifdef reg_ALLOC
dynamic_space_free_pointer =
(lispobj *)(*os_context_register_addr(context, reg_ALLOC));
-#ifdef alpha
+#if defined(LISP_FEATURE_ALPHA)
if ((long)dynamic_space_free_pointer & 1) {
lose("dead in fake_foreign_function_call, context = %x", context);
}
interrupt_handle_now(signal, info, context);
#ifdef LISP_FEATURE_DARWIN
/* Work around G5 bug */
- sigreturn(void_context);
+ DARWIN_FIX_CONTEXT(context);
#endif
}
* awful state, to stop them from being waited for indefinitely.
* Userland reaping is done later when GC is finished */
mark_dead_threads();
-
+ if(thread->state!=STATE_STOPPING) {
+ lose("sig_stop_for_gc_handler: wrong thread state: %ld\n",
+ fixnum_value(thread->state));
+ }
thread->state=STATE_STOPPED;
sigemptyset(&ss); sigaddset(&ss,SIG_STOP_FOR_GC);
sigwaitinfo(&ss,0);
+ if(thread->state!=STATE_STOPPED) {
+ lose("sig_stop_for_gc_handler: wrong thread state on wakeup: %ld\n",
+ fixnum_value(thread->state));
+ }
+ thread->state=STATE_RUNNING;
undo_fake_foreign_function_call(context);
}
os_context_t *context = arch_os_get_context(&void_context);
interrupt_handle_now(signal, info, context);
#ifdef LISP_FEATURE_DARWIN
- sigreturn(void_context);
+ DARWIN_FIX_CONTEXT(context);
#endif
}
extern void post_signal_tramp(void);
void arrange_return_to_lisp_function(os_context_t *context, lispobj function)
{
-#ifndef LISP_FEATURE_X86
+#if !(defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64))
void * fun=native_pointer(function);
void *code = &(((struct simple_fun *) fun)->code);
#endif