Ignore:
Timestamp:
Feb 22, 2009, 11:00:40 AM (11 years ago)
Author:
gb
Message:

In the DEFCLASS for PROCESS, make the THREAD slot have an initform
of NIL.

In MAKE-PROCESS, don't pass the :thread initarg to MAKE-INSTANCE;
if the new instance has a null thread, initialize it. (This is
basically a hack to allow subclasses of PROCESS to initialize
their thread/tcr in a non-default way, without requiring MAKE-PROCESS
or its callers to know the details.

File:
1 edited

Legend:

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

    r11744 r11757  
    115115(defclass process ()
    116116    ((name :initform nil :initarg :name :accessor process-name)
    117      (thread :initarg :thread :accessor process-thread)
     117     (thread :initarg :thread :initform nil :accessor process-thread)
    118118     (initial-form :initform (cons nil nil) :reader process-initial-form)
    119119     (priority :initform 0 :initarg :priority :accessor process-priority)
     
    173173             class
    174174             :name name
    175              :thread (or thread
    176                          (new-thread name stack-size  vstack-size  tstack-size))
    177175             :priority priority
    178176             :persistent persistent
     
    184182                                        (make-semaphore))
    185183             :allocation-quantum allocation-quantum)))
     184    (with-slots ((lisp-thread thread)) p
     185      (unless lisp-thread
     186        (setq lisp-thread
     187              (or thread
     188                  (new-thread name stack-size  vstack-size  tstack-size)))))
    186189    (add-to-all-processes p)
    187190    (setf (car (process-splice p)) p)
Note: See TracChangeset for help on using the changeset viewer.