Changeset 11507


Ignore:
Timestamp:
Dec 11, 2008, 10:12:57 PM (11 years ago)
Author:
gz
Message:

SIGQUIT fix (from r11499/r11500)

Location:
branches/working-0711/ccl/lisp-kernel
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/lisp-kernel/Threads.h

    r11267 r11507  
    240240#endif
    241241
    242 extern int thread_suspend_signal, thread_resume_signal;
     242
     243#ifdef DARWIN
     244#define SIG_KILL_THREAD SIGEMT
     245#endif
     246
     247#if defined(LINUX) && defined(SIGRTMIN)
     248#define SIG_KILL_THREAD (SIGRTMIN+7)
     249#endif
     250
     251#ifdef SOLARIS
     252#define SIG_KILL_THREAD SIGRTMIN
     253#endif
     254
     255#ifdef FREEBSD
     256#define SIG_KILL_THREAD (SIGTHR+5)
     257#endif
     258
     259
     260extern int thread_suspend_signal, thread_kill_signal;
    243261
    244262void *
  • branches/working-0711/ccl/lisp-kernel/lisp-debug.c

    r11267 r11507  
    929929#endif
    930930  {debug_kill_process,
    931    "Kill OpenMCL process",
     931   "Kill Clozure CL process",
    932932   0,
    933933   NULL,
     
    10571057  while (state == debug_continue) {
    10581058#ifdef WINDOWS
    1059     fprintf(stderr, "[%d] OpenMCL kernel debugger: ", (int)GetCurrentProcessId());
     1059    fprintf(stderr, "[%d] Clozure CL kernel debugger: ", (int)GetCurrentProcessId());
    10601060#else
    1061     fprintf(stderr, "[%d] OpenMCL kernel debugger: ", main_thread_pid);
     1061    fprintf(stderr, "[%d] Clozure CL kernel debugger: ", main_thread_pid);
    10621062#endif
    10631063    state = apply_debug_command(xp, readc(), info, why);
     
    11101110lisp_bug(char *string)
    11111111{
    1112   Bug(NULL, "Bug in OpenMCL system code:\n%s", string);
    1113 }
    1114 
     1112  Bug(NULL, "Bug in Clozure CL system code:\n%s", string);
     1113}
     1114
  • branches/working-0711/ccl/lisp-kernel/ppc-exceptions.c

    r11164 r11507  
    21742174
    21752175void
    2176 quit_handler(int signum, siginfo_t info, ExceptionInformation *xp)
     2176thread_kill_handler(int signum, siginfo_t info, ExceptionInformation *xp)
    21772177{
    21782178  TCR *tcr = get_tcr(false);
     
    22062206{
    22072207  thread_suspend_signal = SIG_SUSPEND_THREAD;
     2208  thread_kill_signal = SIG_KILL_THREAD;
    22082209
    22092210  install_signal_handler(thread_suspend_signal, (void *) suspend_resume_handler);
    2210   install_signal_handler(SIGQUIT, (void *)quit_handler);
     2211  install_signal_handler(thread_kill_signal, (void *)thread_kill_handler);
    22112212}
    22122213
  • branches/working-0711/ccl/lisp-kernel/thread_manager.c

    r11412 r11507  
    547547
    548548
    549 int thread_suspend_signal = 0, thread_resume_signal = 0;
     549int thread_suspend_signal = 0, thread_kill_signal = 0;
    550550
    551551
     
    20212021      }
    20222022#else
    2023       if (pthread_kill((pthread_t)osid,SIGQUIT)) {
     2023      if (pthread_kill((pthread_t)osid,thread_kill_signal)) {
    20242024        result = false;
    20252025      }
  • branches/working-0711/ccl/lisp-kernel/x86-exceptions.c

    r11412 r11507  
    20112011#ifdef WINDOWS
    20122012void
    2013 quit_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
    2014 {
    2015 }
    2016 #else
    2017 void
    2018 quit_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
     2013thread_kill_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
     2014{
     2015}
     2016#else
     2017void
     2018thread_kill_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
    20192019{
    20202020#ifdef DARWIN_GS_HACK
     
    20232023  TCR *tcr = get_tcr(false);
    20242024  sigset_t mask;
    2025  
     2025
    20262026  sigemptyset(&mask);
    20272027
    20282028  empty_tcr_stacks(tcr);
    2029  
     2029
    20302030  pthread_sigmask(SIG_SETMASK,&mask,NULL);
    20312031  pthread_exit(NULL);
     
    20362036#ifndef USE_SIGALTSTACK
    20372037void
    2038 arbstack_quit_handler(int signum, siginfo_t *info, ExceptionInformation *context)
     2038arbstack_thread_kill_handler(int signum, siginfo_t *info, ExceptionInformation *context)
    20392039{
    20402040#ifdef DARWIN_GS_HACK
     
    20482048      (current_sp < vs->high)) {
    20492049    handle_signal_on_foreign_stack(tcr,
    2050                                    quit_handler,
     2050                                   thread_kill_handler,
    20512051                                   signum,
    20522052                                   info,
     
    20652065    }
    20662066#endif
    2067     quit_handler(signum, info, context);
    2068   }
    2069 }
    2070 
    2071 
    2072 #else
    2073 void
    2074 altstack_quit_handler(int signum, siginfo_t *info, ExceptionInformation *context)
     2067    thread_kill_handler(signum, info, context);
     2068  }
     2069}
     2070
     2071
     2072#else
     2073void
     2074altstack_thread_kill_handler(int signum, siginfo_t *info, ExceptionInformation *context)
    20752075{
    20762076#ifdef DARWIN_GS_HACK
     
    20792079  TCR* tcr = get_tcr(true);
    20802080  handle_signal_on_foreign_stack(tcr,
    2081                                  quit_handler,
     2081                                 thread_kill_handler,
    20822082                                 signum,
    20832083                                 info,
     
    20942094#ifdef USE_SIGALTSTACK
    20952095#define SUSPEND_RESUME_HANDLER altstack_suspend_resume_handler
    2096 #define QUIT_HANDLER altstack_quit_handler
     2096#define THREAD_KILL_HANDLER altstack_thread_kill_handler
    20972097#else
    20982098#define SUSPEND_RESUME_HANDLER arbstack_suspend_resume_handler
    2099 #define QUIT_HANDLER arbstack_quit_handler
     2099#define THREAD_KILL_HANDLER arbstack_thread_kill_handler
    21002100#endif
    21012101
     
    21102110{
    21112111  thread_suspend_signal = SIG_SUSPEND_THREAD;
     2112  thread_kill_signal = SIG_KILL_THREAD;
    21122113
    21132114  install_signal_handler(thread_suspend_signal, (void *)SUSPEND_RESUME_HANDLER);
    2114   install_signal_handler(SIGQUIT, (void *)QUIT_HANDLER);
     2115  install_signal_handler(thread_kill_signal, (void *)THREAD_KILL_HANDLER);
    21152116}
    21162117#endif
Note: See TracChangeset for help on using the changeset viewer.