;;; -*- Mode: Common-Lisp; Package: User; Base: 10.; Patch-File: T -*-

;;; Reason: Added code to the (process :Kill) method to remove the process from 
;;; delayed-restart-list if it is on it.

;;;                           RESTRICTED RIGHTS LEGEND
;;;
;;; Use, duplication, or disclosure by the Government is subject to
;;; restrictions as set forth in subdivision (c)(1)(ii) of the Rights in
;;; Technical Data and Computer Software clause at 52.227-7013.
;;;
;;;   TEXAS INSTRUMENTS INCORPORATED      
;;;   P.O. BOX 2909, M/S 2151             
;;;   AUSTIN, TEXAS 78769                 
;;;
;;; Copyright (C) 1989 Texas Instruments Incorporated.
;;; All rights reserved.

;;; Patch file for SYSTEM version 6.17
;;; Written 10/02/89 12:59:02 by FISH,
;;; while running on DaVinci from band LOD2
;;; With SYSTEM 6.16, VIRTUAL-MEMORY 6.2, EH 6.5, MAKE-SYSTEM 6.0, MICRONET 6.0, LOCAL-FILE 6.0,
;;;  BASIC-PATHNAME 6.1, NETWORK-SUPPORT-COLD 6.0, BASIC-NAMESPACE 6.2, NETWORK-NAMESPACE 6.0,
;;;  DISK-IO 6.1, DISK-LABEL 6.0, BASIC-FILE 6.3, MAC-PATHNAME 6.0, NETWORK-PATHNAME 6.0,
;;;  COMPILER 6.12, TV 6.15, DATALINK 6.0, CHAOSNET 6.0, GC 6.3, MEMORY-AUX 6.0, NVRAM 6.1,
;;;  SYSLOG 6.1, STREAMER-TAPE 6.4, UCL 6.0, INPUT-EDITOR 6.0, METER 6.1, ZWEI 6.5,
;;;  DEBUG-TOOLS 6.3, NETWORK-SUPPORT 6.0, NETWORK-SERVICE 6.1, DATALINK-DISPLAYS 6.0,
;;;  FONT-EDITOR 6.1, SERIAL 6.0, PRINTER 6.3, MAC-PRINTER-TYPES 6.1, PRINTER-TYPES 6.1,
;;;  IMAGEN 6.0, SUGGESTIONS 6.0, MAIL-DAEMON 6.2, MAIL-READER 6.2, TELNET 6.0, VT100 6.0,
;;;  NAMESPACE-EDITOR 6.0, PROFILE 6.1, VISIDOC 6.4, TI-CLOS 6.20, CLEH 6.5, IP 3.50,
;;;  Experimental CLX 6.3, CLUE 6.17, X11M 6.14, Experimental BUG 11.15, Experimental SEYMOUR3 2.0,
;;;  Experimental SLAP 3.15,  microcode 465, Band Name: rel6 7/25 seymour

#!C
; From file PROCESSES.LISP#> KERNEL; Hotel:
#10R SYSTEM#:
(COMPILER-LET ((*PACKAGE* (FIND-PACKAGE "SYSTEM"))
                          (SI:*LISP-MODE* :COMMON-LISP)
                          (*READTABLE* COMMON-LISP-READTABLE)
                          (SI:*READER-SYMBOL-SUBSTITUTIONS* *COMMON-LISP-SYMBOL-SUBSTITUTIONS*))
  (COMPILER#:PATCH-SOURCE-FILE "SYS: KERNEL; PROCESSES.#"


(defmethod (process :kill) (&optional wait-p)
  (if (or (not wait-p)
	  (eq self current-process))
      (funcall self :reset :always t)  
      (without-interrupts			;Kill the process, waiting for it unwind itself.
	(let ((eh:allow-pdl-grow-message nil)
	      (sg stack-group ))
	  (DECLARE (SPECIAL EH:ALLOW-PDL-GROW-MESSAGE))
	  (unless (sg-never-run-p sg)
	    (eh:unwind-sg sg %current-stack-group nil nil ))
	  (when (listp delayed-restart-processes)
	      (dolist (item delayed-restart-processes)
		(when (eq (car item) self)
		  (setf delayed-restart-processes (delete item delayed-restart-processes)))))
	  (process-disable self)
	  (process-all-processes self nil)
	  (process-allow-schedule)))))
))
