Changeset 11169


Ignore:
Timestamp:
Oct 18, 2008, 11:48:35 PM (11 years ago)
Author:
gb
Message:

Split the business of emptying a TCR's stacks out from quit_handler(),
so it can be called from Windows should the need arise.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/x86-exceptions.c

    r11148 r11169  
    19821982#endif
    19831983
    1984 #ifdef WINDOWS
    1985 void
    1986 quit_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
    1987 {
    1988 }
    1989 #else
    1990 void
    1991 quit_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
    1992 {
    1993 #ifdef DARWIN_GS_HACK
    1994   Boolean gs_was_tcr = ensure_gs_pthread();
    1995 #endif
    1996   TCR *tcr = get_tcr(false);
    1997   area *a;
    1998   sigset_t mask;
    1999  
    2000   sigemptyset(&mask);
    2001 
    2002 
     1984
     1985/* This should only be called when the tcr_area_lock is held */
     1986void
     1987empty_tcr_stacks(TCR *tcr)
     1988{
    20031989  if (tcr) {
     1990    area *a;
     1991
    20041992    tcr->valence = TCR_STATE_FOREIGN;
    20051993    a = tcr->vs_area;
     
    20162004    }
    20172005  }
     2006}
     2007
     2008#ifdef WINDOWS
     2009void
     2010quit_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
     2011{
     2012}
     2013#else
     2014void
     2015quit_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
     2016{
     2017#ifdef DARWIN_GS_HACK
     2018  Boolean gs_was_tcr = ensure_gs_pthread();
     2019#endif
     2020  TCR *tcr = get_tcr(false);
     2021  sigset_t mask;
     2022 
     2023  sigemptyset(&mask);
     2024
     2025  empty_tcr_stacks(tcr);
    20182026 
    20192027  pthread_sigmask(SIG_SETMASK,&mask,NULL);
Note: See TracChangeset for help on using the changeset viewer.