Changeset 11143


Ignore:
Timestamp:
Oct 18, 2008, 1:09:32 AM (11 years ago)
Author:
gb
Message:

Start to bootstrap a change in which (rude) thread termination requires
ownership of the exception lock.

Location:
trunk/source/lisp-kernel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/lisp-errors.h

    r8579 r11143  
    3232#define error_suspend_all 13
    3333#define error_resume 14
    34 #define error_resume_all 15                                     
     34#define error_resume_all 15
     35#define error_kill 16
    3536#define error_cant_call 17
    3637
  • trunk/source/lisp-kernel/thread_manager.c

    r11115 r11143  
    18911891     
    18921892
     1893Boolean
     1894kill_tcr(TCR *tcr)
     1895{
     1896  TCR *current = get_tcr(true);
     1897  Boolean result = false;
     1898
     1899  LOCK(lisp_global(TCR_AREA_LOCK),current);
     1900  {
     1901    LispObj osid = tcr->osid;
     1902   
     1903    if (osid) {
     1904      result = true;
     1905#ifdef WINDOWS
     1906      /* What we really want to de hear is (something like)
     1907         forcing the thread to run quit_handler().  For now,
     1908         mark the TCR as dead and kill thw Windows thread. */
     1909      tcr->osid = 0;
     1910      if (!TerminateThread(osid)) {
     1911        result = false;
     1912      }
     1913#else
     1914      if (pthread_kill(osid,SIGQUIT)) {
     1915        result = false;
     1916      }
     1917#endif
     1918    }
     1919  }
     1920  UNLOCK(lisp_global(TCR_AREA_LOCK), current);
     1921  return result;
     1922}
    18931923
    18941924Boolean
  • trunk/source/lisp-kernel/x86-exceptions.c

    r11113 r11143  
    10841084        return true;
    10851085       
     1086      case XUUO_KILL:
     1087        kill_tcr(target);
     1088        xpPC(context)+=3;
     1089        break;
    10861090      default:
    10871091        return false;
  • trunk/source/lisp-kernel/x86-exceptions.h

    r11015 r11143  
    143143#define XUUO_RESUME 7
    144144#define XUUO_RESUME_ALL 8
     145#define XUUO_KILL 9
    145146
    146147void
Note: See TracChangeset for help on using the changeset viewer.