source: trunk/source/level-1/l1-processes.lisp @ 10426

Last change on this file since 10426 was 10426, checked in by gb, 11 years ago

Merge a lot of the CLOS/type-system changes from working-0711 branch
into trunk. Todo: compiler-macros for those changes.

Have -not- yet merged source-tracking changes, new record-source file
from working-0711, but this stuff seems to bootstrap in one swell foop.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 23.7 KB
Line 
1;;;-*- Mode: Lisp; Package: CCL -*-
2;;;
3;;;   Copyright (C) 1994-2001 Digitool, Inc
4;;;   This file is part of OpenMCL. 
5;;;
6;;;   OpenMCL is licensed under the terms of the Lisp Lesser GNU Public
7;;;   License , known as the LLGPL and distributed with OpenMCL as the
8;;;   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
9;;;   which is distributed with OpenMCL as the file "LGPL".  Where these
10;;;   conflict, the preamble takes precedence. 
11;;;
12;;;   OpenMCL is referenced in the preamble as the "LIBRARY."
13;;;
14;;;   The LLGPL is also available online at
15;;;   http://opensource.franz.com/preamble.html
16
17
18;; L1-processes.lisp
19
20(cl:in-package "CCL")
21
22
23(let* ((all-processes ())
24       (shutdown-processes ())
25       (all-processes-lock (make-lock)))
26  (defun add-to-all-processes (p)
27    (with-lock-grabbed (all-processes-lock)
28      (pushnew p all-processes :test #'eq)
29      p))
30  (defun remove-from-all-processes (p)
31    (with-lock-grabbed (all-processes-lock)
32      (setq all-processes (delete p all-processes))
33      t))
34  (defun all-processes ()
35    "Obtain a fresh list of all known Lisp threads."
36    (with-lock-grabbed (all-processes-lock)
37      (copy-list all-processes)))
38  (defun shutdown-processes ()
39    (with-lock-grabbed (all-processes-lock)
40      (copy-list shutdown-processes)))
41  (defun %clear-shutdown-proceses ()
42    (setq shutdown-processes nil))
43  (defun add-to-shutdown-processes (p)
44    (with-lock-grabbed (all-processes-lock)
45      (pushnew p shutdown-processes :test #'eq))
46    t)
47  (defun pop-shutdown-processes ()
48    (with-lock-grabbed (all-processes-lock)
49      (pop shutdown-processes)))
50  (defun find-process (id)
51    (etypecase id
52      (process id)
53      (integer (with-lock-grabbed (all-processes-lock)
54                 (find id all-processes
55                       :key #'(lambda (p)
56                                (process-serial-number p)))))
57      (string (with-lock-grabbed (all-processes-lock)
58                (find id all-processes
59                      :key #'(lambda (p)
60                               (process-name p))
61                      :test #'equal))))))
62
63
64
65(defun not-in-current-process (p operation)
66  (if (eq p *current-process*)
67    (error "The current process (~s) can't perform the ~a operation on itself."
68           p operation)))
69
70(defun startup-shutdown-processes ()
71  (let* ((p))
72    (loop
73      (unless (setq p (pop-shutdown-processes)) (return))
74      (new-tcr-for-thread (process-thread p))
75      (%process-preset-internal p)
76      (process-enable p)
77      )))
78
79;;; Done with a queue-fixup so that it will be the last thing
80;;; that happens on startup.
81(queue-fixup
82 (pushnew 'startup-shutdown-processes *lisp-system-pointer-functions*))
83
84
85
86
87
88
89
90(defun wrap-initial-bindings (alist)
91  (mapcar #'(lambda (pair)
92              (destructuring-bind (symbol . valform) pair
93                (cons (require-type symbol 'symbol)
94                      (cond ((symbolp valform)
95                             (constantly (symbol-value valform)))
96                            ((typep valform 'function) valform)
97                            ((consp valform)
98                             (if (eq (car valform) 'quote)
99                               (constantly (cadr valform))
100                               #'(lambda () (apply (car valform) (cdr valform)))))
101                            (t
102                             (constantly valform))))))
103          alist))
104
105
106(defun valid-allocation-quantum-p (x)
107  (and (>= x *host-page-size*)
108       (<= x (default-allocation-quantum))
109       (= (logcount x) 1)))
110
111 
112(let* ((psn -1))
113  (defun %new-psn () (incf psn)))
114
115(defclass process ()
116    ((name :initform nil :initarg :name :accessor process-name)
117     (thread :initarg :thread :accessor process-thread)
118     (initial-form :initform (cons nil nil) :reader process-initial-form)
119     (priority :initform 0 :initarg :priority :accessor process-priority)
120     (persistent :initform nil :initarg :persistent :reader process-persistent)
121     (splice :initform (cons nil nil) :accessor process-splice)
122     (initial-bindings :initform nil :initarg :initial-bindings
123                       :accessor process-initial-bindings)
124     (serial-number :initform (%new-psn) :accessor process-serial-number)
125     (creation-time :initform (get-tick-count) :reader process-creation-time)
126     (total-run-time :initform nil :accessor %process-total-run-time)
127     (ui-object :initform (application-ui-object *application*)
128                :accessor process-ui-object)
129     (termination-semaphore :initform nil
130                            :initarg :termination-semaphore
131                            :accessor process-termination-semaphore
132                            :type (or null semaphore))
133     (allocation-quantum :initform (default-allocation-quantum)
134                         :initarg :allocation-quantum
135                         :reader process-allocation-quantum
136                         :type (satisfies valid-allocation-quantum-p))
137     (dribble-stream :initform nil)
138     (dribble-saved-terminal-io :initform nil)
139     (result :initform (cons nil nil)
140             :reader process-result))
141  (:primary-p t))
142
143(defmethod print-object ((p process) s)
144  (print-unreadable-object (p s :type t :identity t)
145    (format s "~a(~d) [~a]" (process-name p)
146            (process-serial-number p)(process-whostate p))))
147
148(defvar *process-class* (find-class 'process))
149
150(defun processp (p)
151  (memq *process-class* (class-precedence-list (class-of p))))
152
153(set-type-predicate 'process 'processp)
154
155(defun make-process (name &key 
156                          thread
157                          persistent
158                          (priority 0)
159                          (stack-size *default-control-stack-size*)
160                          (vstack-size *default-value-stack-size*)
161                          (tstack-size *default-temp-stack-size*)
162                          (initial-bindings ())
163                          (use-standard-initial-bindings t)
164                          (class (find-class 'process))
165                          (termination-semaphore ())
166                          (allocation-quantum (default-allocation-quantum)))
167  "Create and return a new process."
168  (let* ((p (make-instance
169             class
170             :name name
171             :thread (or thread
172                         (new-thread name stack-size  vstack-size  tstack-size))
173             :priority priority
174             :persistent persistent
175             :initial-bindings (append (if use-standard-initial-bindings
176                                         (standard-initial-bindings))
177                                       (wrap-initial-bindings
178                                        initial-bindings))
179             :termination-semaphore (or termination-semaphore
180                                        (make-semaphore))
181             :allocation-quantum allocation-quantum)))
182    (add-to-all-processes p)
183    (setf (car (process-splice p)) p)
184    p))
185
186
187(defstatic *initial-process*
188    (let* ((p (make-process
189               "Initial"
190               :thread *initial-lisp-thread*
191               :priority 0)))
192      p))
193
194
195(defvar *current-process* *initial-process*
196  "Bound in each process, to that process itself.")
197
198(defstatic *interactive-abort-process* *initial-process*)
199
200
201
202
203(defun process-tcr (p)
204  (lisp-thread.tcr (process-thread p)))
205
206
207
208(defun process-exhausted-p (p)
209  (let* ((thread (process-thread p)))
210    (or (null thread)
211        (thread-exhausted-p thread))))
212 
213
214(defun process-whostate (p)
215  "Return a string which describes the status of a specified process."
216  (if (process-exhausted-p p)
217    "Exhausted"
218    (let* ((loc nil))
219    (if (eq p *current-process*)
220      (setq loc (%tcr-binding-location (%current-tcr) '*whostate*))
221      (let* ((tcr (process-tcr p)))
222        (without-interrupts
223         (unwind-protect
224              (progn
225                (%suspend-tcr tcr)
226                (setq loc (%tcr-binding-location tcr '*whostate*)))
227           (%resume-tcr tcr)))))
228    (if loc
229      (%fixnum-ref loc)
230      (if (eq p *initial-process*)
231        "Active"
232        "Reset")))))
233
234(defun (setf process-whostate) (new p)
235  (unless (process-exhausted-p p)
236    (setf (symbol-value-in-process '*whostate* p) new)))
237
238
239
240(defun process-total-run-time (p)
241  (or (%process-total-run-time p)
242      (thread-total-run-time (process-thread p))))
243
244
245
246
247(defun initial-bindings (alist)
248  (let* ((symbols ())
249         (values ()))
250    (dolist (a alist (values (nreverse symbols) (nreverse values)))
251      (push (car a) symbols)
252      (push (funcall (cdr a)) values))))
253
254
255                           
256(defun symbol-value-in-process (sym process)
257  (if (eq process *current-process*)
258    (symbol-value sym)
259    (symbol-value-in-tcr sym (process-tcr process))))
260
261(defun (setf symbol-value-in-process) (value sym process)
262  (if (eq process *current-process*)
263    (setf (symbol-value sym) value)
264    (setf (symbol-value-in-tcr sym (process-tcr process)) value)))
265
266
267(defun process-enable (p &optional (wait (* 60 60 24) wait-p))
268  "Begin executing the initial function of a specified process."
269  (setq p (require-type p 'process))
270  (not-in-current-process p 'process-enable)
271  (when wait-p
272    (check-type wait (unsigned-byte 32)))
273  (unless (car (process-initial-form p))
274    (error "Process ~s has not been preset.  Use PROCESS-PRESET to preset the process." p))
275  (let* ((thread (process-thread p)))
276    (do* ((total-wait wait (+ total-wait wait)))
277         ((thread-enable thread (process-termination-semaphore p) (1- (integer-length (process-allocation-quantum p)))  wait)
278          p)
279      (cerror "Keep trying."
280              "Unable to enable process ~s; have been trying for ~s seconds."
281              p total-wait))))
282
283
284(defmethod (setf process-termination-semaphore) :after (new (p process))
285  (with-macptrs (tcrp)
286    (%setf-macptr-to-object tcrp (process-tcr p))
287    (unless (%null-ptr-p tcrp)
288      (setf (%get-ptr tcrp target::tcr.termination-semaphore)
289            (if new
290              (semaphore-value new)
291              (%null-ptr))))
292    new))
293
294(defun process-resume (p)
295  "Resume a specified process which had previously been suspended
296by process-suspend."
297  (setq p (require-type p 'process))
298  (let* ((tcr (process-tcr p)))
299    (and tcr (%resume-tcr tcr))))
300
301(defun process-suspend (p)
302  "Suspend a specified process."
303  (setq p (require-type p 'process))
304  (if (eq p *current-process*)
305    (error "Suspending the current process can't work.  ~&(If the documentation claims otherwise, it's incorrect.)")
306    (let* ((tcr (process-tcr p)))
307      (and tcr (%suspend-tcr tcr)))))
308
309(defun process-suspend-count (p)
310  "Return the number of currently-pending suspensions applicable to
311a given process."
312  (setq p (require-type p 'process))
313  (let* ((thread (process-thread p)))
314    (if thread
315      (lisp-thread-suspend-count thread))))
316
317(defun process-active-p (p)
318  (setq p (require-type p 'process))
319  (and (eql 0 (process-suspend-count p))
320       (not (process-exhausted-p p))))
321 
322;;; Used by process-run-function
323(defun process-preset (process function &rest args)
324  "Set the initial function and arguments of a specified process."
325  (let* ((p (require-type process 'process))
326         (f (require-type function 'function))
327         (initial-form (process-initial-form p)))
328    (declare (type cons initial-form))
329    (not-in-current-process p 'process-preset)
330    ; Not quite right ...
331    (rplaca initial-form f)
332    (rplacd initial-form args)
333    (%process-preset-internal process)))
334
335(defun %process-preset-internal (process)
336   (let* ((initial-form (process-initial-form process))
337         (thread (process-thread process)))
338     (declare (type cons initial-form))
339     (thread-preset
340      thread
341      #'(lambda (process initial-form)
342          (let* ((*current-process* process))
343            (add-to-all-processes process)
344            (multiple-value-bind (syms values)
345                (initial-bindings (process-initial-bindings process))
346              (progv syms values
347                (setq *whostate* "Active")
348                (run-process-initial-form process initial-form)))))
349      process
350      initial-form)
351     process))
352
353
354(defun run-process-initial-form (process initial-form)
355  (let* ((exited nil)
356         (kill (handler-case
357                   (restart-case
358                    (let ((values
359                           (multiple-value-list
360                            (apply (car initial-form)
361                                   (cdr (the list initial-form)))))
362                          (result (process-result process)))
363                      (setf (cdr result) values
364                            (car result) t)
365                      (setq exited t)
366                      nil)
367                    (abort-break () :report "Reset this process")
368                    (abort () :report "Kill this process" (setq exited t)))
369                 (process-reset (condition)
370                   (process-reset-kill condition)))))
371    ;; We either exited from the initial form normally, were told to
372    ;; exit prematurely, or are being reset and should enter the
373    ;; "awaiting preset" state.
374    (if (or kill exited) 
375      (unless (eq kill :toplevel)
376        (process-initial-form-exited process (or kill t)))
377      (progn
378        (thread-change-state (process-thread process) :run :reset)
379        (tcr-set-preset-state (process-tcr process))))
380    nil))
381
382;;; Separated from run-process-initial-form just so I can change it easily.
383(defun process-initial-form-exited (process kill)
384  ;; Enter the *initial-process* and have it finish us up
385  (without-interrupts
386   (if (eq kill :shutdown)
387     (progn
388       (setq *whostate* "Shutdown")
389       (add-to-shutdown-processes process)))
390   (maybe-finish-process-kill process kill)))
391
392(defun maybe-finish-process-kill (process kill)
393  (when (and kill (neq kill :shutdown))
394    (setf (process-whostate process) "Dead")
395    (remove-from-all-processes process)
396    (let ((thread (process-thread process)))
397      (unless (or (eq thread *current-lisp-thread*)
398                  (thread-exhausted-p thread))
399        (kill-lisp-thread thread))))
400  nil)
401
402
403 
404
405(defun require-global-symbol (s &optional env)
406  (let* ((s (require-type s 'symbol))
407         (bits (%symbol-bits s)))
408    (unless (or (logbitp $sym_vbit_global bits)
409                (let* ((defenv (if env (definition-environment env))))
410                  (if defenv
411                    (eq :global (%cdr (assq s (defenv.specials defenv)))))))
412      (error "~s not defined with ~s" s 'defstatic))
413    s))
414
415
416(defmethod print-object ((s lock) stream)
417  (print-unreadable-object (s stream :type t :identity t)
418    (let* ((val (uvref s target::lock._value-cell))
419           (name (uvref s target::lock.name-cell)))
420      (when name
421        (format stream "~s " name))
422      (if (typep val 'macptr)
423        (format stream "[ptr @ #x~x]"
424                (%ptr-to-int val))))))
425
426(defun lockp (l)
427  (eq target::subtag-lock (typecode l)))
428
429(set-type-predicate 'lock 'lockp)
430
431(defun recursive-lock-p (l)
432  (and (eq target::subtag-lock (typecode l))
433       (eq 'recursive-lock (%svref l target::lock.kind-cell))))
434
435(defun read-write-lock-p (l)
436  (and (eq target::subtag-lock (typecode l))
437       (eq 'read-write-lock (%svref l target::lock.kind-cell))))
438
439(setf (type-predicate 'recursive-lock) 'recursive-lock-p
440      (type-predicate 'read-write-lock) 'read-write-lock-p)
441
442
443(defun grab-lock (lock &optional flag)
444  "Wait until a given lock can be obtained, then obtain it."
445  (%lock-recursive-lock-object lock flag))
446
447(defun release-lock (lock)
448  "Relinquish ownership of a given lock."
449  (%unlock-recursive-lock-object lock))
450
451(defun try-lock (lock &optional flag)
452  "Obtain the given lock, but only if it is not necessary to wait for it."
453  (%try-recursive-lock-object lock flag))
454
455(defun lock-acquisition-status (thing)
456  (if (istruct-typep thing 'lock-acquisition)
457    (lock-acquisition.status thing)
458    (report-bad-arg thing 'lock-acquisition)))
459
460(defun clear-lock-acquisition-status (thing)
461  (if (istruct-typep thing 'lock-acquisition)
462    (setf (lock-acquisition.status thing) nil)
463    (report-bad-arg thing 'lock-acquisition)))
464
465(defmethod print-object ((l lock-acquisition) stream)
466  (print-unreadable-object (l stream :type t :identity t)
467    (format stream "[status = ~s]" (lock-acquisition-status l))))
468
469(defun semaphore-notification-status (thing)
470  (if (istruct-typep thing 'semaphore-notification)
471    (semaphore-notification.status thing)
472    (report-bad-arg thing 'semaphore-notification)))
473
474(defun clear-semaphore-notification-status (thing)
475  (if (istruct-typep thing 'semaphore-notification)
476    (setf (semaphore-notification.status thing) nil)
477    (report-bad-arg thing 'semaphore-notification)))
478
479(defmethod print-object ((l semaphore-notification) stream)
480  (print-unreadable-object (l stream :type t :identity t)
481    (format stream "[status = ~s]" (semaphore-notification-status l))))
482
483(defun process-wait (whostate function &rest args)
484  "Causes the current lisp process (thread) to wait for a given
485predicate to return true."
486  (declare (dynamic-extent args))
487  (or (apply function args)
488      (with-process-whostate (whostate)
489        (loop
490          (when (apply function args)
491            (return))
492          ;; Sleep for a tick
493          (%nanosleep 0 *ns-per-tick*)))))
494
495
496
497(defun process-wait-with-timeout (whostate time function &rest args)
498  "Cause the current thread to wait for a given predicate to return true,
499or for a timeout to expire."
500  (declare (dynamic-extent args))
501  (cond ((null time)  (apply #'process-wait whostate function args) t)
502        (t (let* ((win nil)
503                  (when (+ (get-tick-count) time))
504                  (f #'(lambda () (let ((val (apply function args)))
505                                    (if val
506                                      (setq win val)
507                                      (> (get-tick-count) when))))))
508             (declare (dynamic-extent f))
509             (process-wait whostate f)
510             win))))
511
512
513(defmethod process-interrupt ((process process) function &rest args)
514  "Arrange for the target process to invoke a specified function at
515some point in the near future, and then return to what it was doing."
516  (let* ((p (require-type process 'process)))
517    (if (eq p *current-process*)
518      (progn
519        (apply function args)
520        t)
521      (thread-interrupt
522       (process-thread p)
523       process
524       #'apply
525       function args))))
526
527(defmethod process-debug-condition ((p process) condition frame-pointer)
528  (declare (ignore condition frame-pointer)))
529
530
531
532
533;;; This one is in the Symbolics documentation
534(defun process-allow-schedule ()
535  "Used for cooperative multitasking; probably never necessary."
536  (yield))
537
538
539;;; something unique that users won't get their hands on
540(defun process-reset-tag (process)
541  (process-splice process))
542
543(defun process-run-function (name-or-keywords function &rest args)
544  "Create a process, preset it, and enable it."
545  (if (listp name-or-keywords)
546    (%process-run-function name-or-keywords function args)
547    (let ((keywords (list :name name-or-keywords)))
548      (declare (dynamic-extent keywords))
549      (%process-run-function keywords function args))))
550
551(defun %process-run-function (keywords function args)
552  (destructuring-bind (&key (name "Anonymous")
553                            (priority  0)
554                            (stack-size *default-control-stack-size*)
555                            (vstack-size *default-value-stack-size*)
556                            (tstack-size *default-temp-stack-size*)
557                            (initial-bindings ())
558                            (persistent nil)
559                            (use-standard-initial-bindings t)
560                            (termination-semaphore nil)
561                            (allocation-quantum (default-allocation-quantum)))
562                      keywords
563    (setq priority (require-type priority 'fixnum))
564    (let* ((process (make-process name
565                                  :priority priority
566                                  :stack-size stack-size
567                                  :vstack-size vstack-size
568                                  :tstack-size tstack-size
569                                  :persistent persistent
570                                  :use-standard-initial-bindings use-standard-initial-bindings
571                                  :initial-bindings initial-bindings
572                                  :termination-semaphore termination-semaphore
573                                  :allocation-quantum allocation-quantum)))
574      (process-preset process #'(lambda () (apply function args)))
575      (process-enable process)
576      process)))
577
578(defmethod process-reset ((process process) &optional kill)
579  "Cause a specified process to cleanly exit from any ongoing computation."
580  (setq process (require-type process 'process))
581  (unless (memq kill '(nil :kill :shutdown))
582    (setq kill (require-type kill '(member nil :kill :shutdown))))
583  (if (eq process *current-process*)
584    (%process-reset kill)
585    (if (process-exhausted-p process)
586      (maybe-finish-process-kill process kill)
587      (progn
588        (process-interrupt process '%process-reset kill)))))
589
590
591(defun %process-reset (kill)
592  (signal 'process-reset :kill kill)
593  (maybe-finish-process-kill *current-process* kill))
594
595;;; By default, it's just fine with the current process
596;;; if the application/user wants to quit.
597(defmethod process-verify-quit ((process process))
598  t)
599
600(defmethod process-exit-application ((process process) thunk)
601  (when (eq process *initial-process*)
602    (prepare-to-quit)
603    (%set-toplevel thunk)
604    (fresh-line *stdout*)
605    (finish-output *stdout*)
606    (toplevel)))
607
608
609
610(defmethod process-kill ((process process))
611  "Cause a specified process to cleanly exit from any ongoing
612computation, and then exit."
613  (and (process-interrupt process #'%process-reset :kill)
614       (setf (process-kill-issued process) t)))
615
616(defun process-abort (process &optional condition)
617  "Cause a specified process to process an abort condition, as if it
618had invoked abort."
619  (process-interrupt process
620                     #'(lambda ()
621                         (abort condition))))
622
623(defmethod process-reset-and-enable ((process process))
624  (not-in-current-process process 'process-reset-and-enable)
625  (process-reset process)
626  (process-enable process))
627
628(defmethod process-kill-issued ((process process))
629  (cdr (process-splice process)))
630
631(defmethod (setf process-kill-issued) (val (process process))
632  (setf (cdr (process-splice process)) val))
633
634(defun tcr->process (tcr)
635  (dolist (p (all-processes))
636    (when (eq tcr (process-tcr p))
637      (return p))))
638
639(defun current-process-allocation-quantum ()
640  (process-allocation-quantum *current-process*))
641
642(defun (setf current-process-allocation-quantum) (new)
643  (if (valid-allocation-quantum-p new)
644    (with-macptrs (tcrp)
645      (%setf-macptr-to-object tcrp (%current-tcr))
646      (setf (slot-value *current-process* 'allocation-quantum) new
647            (%get-natural tcrp target::tcr.log2-allocation-quantum)
648            (1- (integer-length new)))
649      new)
650    (report-bad-arg new '(satisfies valid-allocation-quantum-p))))
651
652
653(def-standard-initial-binding *backtrace-contexts* nil)
654
655(defmethod exit-interactive-process ((p process))
656  (unless (eq p *initial-process*)
657    (when (eq p *current-process*)
658      (process-kill p))))
659
660(defclass tty-listener (process)
661    ())
662
663(defmethod exit-interactive-process ((p tty-listener))
664  (when (eq p *current-process*)
665    (quit)))
666
667(defmethod process-stop-dribbling ((p process))
668  (with-slots (dribble-stream dribble-saved-terminal-io) p
669    (when dribble-stream
670      (close dribble-stream)
671      (setq dribble-stream nil))
672    (when dribble-saved-terminal-io
673      (setq *terminal-io* dribble-saved-terminal-io
674            dribble-saved-terminal-io nil))))
675
676(defmethod process-dribble ((p process) path)
677  (with-slots (dribble-stream dribble-saved-terminal-io) p
678    (process-stop-dribbling p)
679    (when path
680      (let* ((in (two-way-stream-input-stream *terminal-io*))
681             (out (two-way-stream-output-stream *terminal-io*))
682             (f (open path :direction :output :if-exists :append 
683                      :if-does-not-exist :create)))
684        (without-interrupts
685         (setq dribble-stream f
686               dribble-saved-terminal-io *terminal-io*
687               *terminal-io* (make-echoing-two-way-stream
688                              (make-echo-stream in f)
689                              (make-broadcast-stream out f)))))
690      path)))
691
692(defmethod join-process ((p process) &key (default nil defaultp))
693  (wait-on-semaphore (process-termination-semaphore p) nil "join-process")
694  (let ((result (process-result p)))
695    (cond ((car result) (values-list (cdr result)))
696          (defaultp default)
697          (t (error "Failed to join ~s" p)))))
698
699
700(defmethod process-locks-held ((p process))
701  #+lock-accounting
702  (copy-list (symbol-value-in-process '*locks-held* p)))
703
704(defmethod process-locks-pending ((p process))
705  #+lock-accounting
706  (copy-list (symbol-value-in-process '*locks-pending* p)))
Note: See TracBrowser for help on using the repository browser.