Changeset 13090
- Timestamp:
- Oct 22, 2009, 2:57:15 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/working-0711/ccl/level-1/l1-lisp-threads.lisp
r13070 r13090 988 988 (let* ((found nil)) 989 989 (with-lock-grabbed (*termination-population-lock*) 990 ;; Have to defer GCing, e.g., defer responding to a GC 991 ;; suspend request here (that also defers interrupts) 992 ;; We absolutely, positively can't take an exception 993 ;; in here, so don't even bother to typecheck on 994 ;; car/cdr etc. 995 (with-deferred-gc 996 (do ((spine (population-data *termination-population*) (cdr spine)) 997 (prev nil spine)) 998 ((null spine)) 999 (declare (optimize (speed 3) (safety 0))) 1000 (let* ((head (car spine)) 1001 (tail (cdr spine)) 1002 (o (car head)) 1003 (f (cdr head))) 990 ;; We don't really need to be very paranoid here. Nothing can 991 ;; be added to the termination queue while we hold the lock, 992 ;; and the GC can't splice anything out of the list while 993 ;; we hold a strong reference to that list. 994 (let* ((population *termination-population*) 995 (queue (population.data population))) 996 (do* ((prev nil spine) 997 (spine queue (cdr spine))) 998 ((null spine)) 999 (let* ((entry (car spine))) 1000 (destructuring-bind (o . f) entry 1004 1001 (when (and (eq o object) 1005 1002 (or (null function-p) 1006 1003 (eq function f))) 1007 1004 (if prev 1008 (setf (cdr prev) tail)1009 (setf (population -data *termination-population*) tail))1005 (setf (cdr prev) (cdr spine)) 1006 (setf (population.data population) (cdr spine))) 1010 1007 (setq found t) 1011 1008 (return))))) 1012 found))) 1009 found)))) 1013 1010 1014 1011
Note:
See TracChangeset
for help on using the changeset viewer.
