Changeset 7949


Ignore:
Timestamp:
Dec 26, 2007, 7:59:33 AM (12 years ago)
Author:
gb
Message:

Keep whostate in a per-thread variable, not in the PROCESS-OBJECT.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/level-1/l1-processes.lisp

    r7853 r7949  
    119119     (priority :initform 0 :initarg :priority :accessor process-priority)
    120120     (persistent :initform nil :initarg :persistent :reader process-persistent)
    121      (whostate :initform "Reset" :accessor %process-whostate)
    122121     (splice :initform (cons nil nil) :accessor process-splice)
    123122     (initial-bindings :initform nil :initarg :initial-bindings
     
    192191               :thread *initial-lisp-thread*
    193192               :priority 0)))
    194       (setf (%process-whostate p) "Active")
    195193      p))
    196194
     
    219217  (if (process-exhausted-p p)
    220218    "Exhausted"
    221     (%process-whostate p)))
    222 
    223 
     219    (symbol-value-in-process '*whostate* p)))
     220
     221(defun (setf process-whostate) (new p)
     222  (unless (process-exhausted-p p)
     223    (setf (symbol-value-in-process '*whostate* p) new)))
    224224
    225225
     
    257257    (do* ((total-wait wait (+ total-wait wait)))
    258258         ((thread-enable thread (process-termination-semaphore p) (1- (integer-length (process-allocation-quantum p)))  wait)
    259           (setf (%process-whostate p) "Active")
    260259          p)
    261260      (cerror "Keep trying."
     
    325324                (initial-bindings (process-initial-bindings process))
    326325              (progv syms values
     326                (setq *whostate* "Active")
    327327                (run-process-initial-form process initial-form)))))
    328328      process
     
    356356      (progn
    357357        (thread-change-state (process-thread process) :run :reset)
    358         (tcr-set-preset-state (process-tcr process))
    359         (setf (%process-whostate process) "Reset")))
     358        (tcr-set-preset-state (process-tcr process))))
    360359    nil))
    361360
     
    366365   (if (eq kill :shutdown)
    367366     (progn
    368        (setf (%process-whostate process) "Shutdown")
     367       (setq *whostate* "Shutdown")
    369368       (add-to-shutdown-processes process)))
    370369   (maybe-finish-process-kill process kill)))
     
    372371(defun maybe-finish-process-kill (process kill)
    373372  (when (and kill (neq kill :shutdown))
    374     (setf (%process-whostate process) "Dead")
     373    (setf (process-whostate process) "Dead")
    375374    (remove-from-all-processes process)
    376375    (let ((thread (process-thread process)))
Note: See TracChangeset for help on using the changeset viewer.