Ignore:
Timestamp:
Sep 9, 2009, 8:47:04 AM (10 years ago)
Author:
gb
Message:

Don't copy a thread's termination semaphore to the TCR (so don't
signal it in the last stages of thread termination, possibly after
the lisp pointer to the semaphore has been GCed.)

Do try to signal it from lisp code, at least in cases where the thread
terminates normally (in PROCESS-INITIAL-FORM-EXITED).

Seems to fix ticket:598.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-processes.lisp

    r12205 r12798  
    319319    ))
    320320
    321 (defmethod (setf process-termination-semaphore) :after (new (p process))
    322   (with-macptrs (tcrp)
    323     (%setf-macptr-to-object tcrp (process-tcr p))
    324     (unless (%null-ptr-p tcrp)
    325       (setf (%get-ptr tcrp target::tcr.termination-semaphore)
    326             (if new
    327               (semaphore-value new)
    328               (%null-ptr))))
    329     new))
     321
    330322
    331323(defun process-resume (p)
     
    418410;;; Separated from run-process-initial-form just so I can change it easily.
    419411(defun process-initial-form-exited (process kill)
    420   ;; Enter the *initial-process* and have it finish us up
    421412  (without-interrupts
    422413   (if (eq kill :shutdown)
     
    424415       (setq *whostate* "Shutdown")
    425416       (add-to-shutdown-processes process)))
     417   (let* ((semaphore (process-termination-semaphore process)))
     418     (when semaphore (signal-semaphore semaphore)))
    426419   (maybe-finish-process-kill process kill)))
    427420
Note: See TracChangeset for help on using the changeset viewer.