do (format t "Installing ~A in ~A,~A~%"
p source system)
append (install-package source system p)))
- (handler-case
- (asdf:operate 'asdf:load-op asd)
- (asdf:missing-dependency (c)
- (format t
- "Downloading package ~A, required by ~A~%"
- (asdf::missing-requires c)
- (asdf:component-name
- (asdf::missing-required-by c)))
- (one-iter (list
- (symbol-name
- (asdf::missing-requires c)))))))))
+ (handler-bind
+ ((asdf:missing-dependency
+ (lambda (c)
+ (format t
+ "Downloading package ~A, required by ~A~%"
+ (asdf::missing-requires c)
+ (asdf:component-name
+ (asdf::missing-required-by c)))
+ (one-iter (list
+ (symbol-name
+ (asdf::missing-requires c))))
+ (invoke-restart 'retry))))
+ (loop
+ (multiple-value-bind (ret restart-p)
+ (with-simple-restart
+ (retry "Retry installation")
+ (asdf:operate 'asdf:load-op asd))
+ (unless restart-p (return))))))))
(one-iter packages)))
(dolist (l *temporary-files*)
- (when (probe-file l) (delete-file l))))))
+ (when (probe-file l) (delete-file l))))))
;; !UNIX-COLD-INIT. And *TYPE-SYSTEM-INITIALIZED* could be changed to
;; *TYPE-SYSTEM-INITIALIZED-WHEN-BOUND* so that it doesn't need to
;; be explicitly set in order to be meaningful.
- (setf *gc-notify-stream* nil
- *before-gc-hooks* nil
+ (setf *before-gc-hooks* nil
*after-gc-hooks* nil
*gc-inhibit* 1
*need-to-collect-garbage* nil
classes)))
(compared (if compare
(compare-stats compensated compare)
- compensated))
- (*gc-notify-stream* nil))
+ compensated)))
(multiple-value-bind (total-count total-cost) (cost-summary compensated)
(multiple-value-bind (compare-total-count compare-total-cost)
(when compare (cost-summary compare))
(defvar *before-gc-hooks* nil ; actually initialized in cold init
#!+sb-doc
"A list of functions that are called before garbage collection occurs.
- The functions should take no arguments.")
+ The functions are run with interrupts disabled and all other threads
+ paused. They should take no arguments.")
(defvar *after-gc-hooks* nil ; actually initialized in cold init
#!+sb-doc
"A list of functions that are called after garbage collection occurs.
- The functions should take no arguments.")
-
-(defvar *gc-notify-stream* nil ; (actually initialized in cold init)
- #!+sb-doc
- "When non-NIL, this must be a STREAM; and the functions bound to
- *GC-NOTIFY-BEFORE* and *GC-NOTIFY-AFTER* are called with the
- STREAM value before and after a garbage collection occurs
- respectively.")
+ The functions are run with interrupts disabled and all other threads
+ paused. They should take no arguments.")
(defvar *gc-run-time* 0
#!+sb-doc
(let ((*already-in-gc* t))
(without-interrupts
(gc-stop-the-world)
- ;; XXX run before-gc-hooks
+ (dolist (h *before-gc-hooks*)
+ (carefully-funcall h))
(collect-garbage gen)
(incf *n-bytes-freed-or-purified*
(max 0 (- pre-gc-dynamic-usage (dynamic-usage))))
(setf *need-to-collect-garbage* nil)
- ;; XXX run after-gc-hooks
+ (dolist (h *after-gc-hooks*)
+ (carefully-funcall h))
(gc-start-the-world)))
(scrub-control-stack)))
(values))
*software-interrupt-vector* *load-verbose*
*load-print-stuff* *in-compilation-unit*
*aborted-compilation-unit-count* *char-name-alist*
- *gc-notify-before* *gc-notify-after*
*posix-argv*))
(declaim (ftype (function * *)
;;; FIXME: These could be converted to DEFVARs.
(declaim (special *gc-inhibit* *need-to-collect-garbage*
- *gc-notify-stream*
*before-gc-hooks* *after-gc-hooks*
#!+x86 *pseudo-atomic-atomic*
#!+x86 *pseudo-atomic-interrupted*
(lambda ()
(with-mutex (lock)
(assert (eql (mutex-value lock) (current-thread-id))))
- (assert (not (eql (mutex-value lock) (current-thread-id)))))))
+ (assert (not (eql (mutex-value lock) (current-thread-id))))
+ (sleep 60))))
;;hold onto lock for long enough that child can't get it immediately
(sleep 20)
(interrupt-thread child (lambda () (format t "l ~A~%" (mutex-value lock))))
(defun alloc-stuff () (copy-list '(1 2 3 4 5)))
(let ((c (test-interrupt (lambda () (loop (alloc-stuff))))))
;; NB this only works on x86
- (dotimes (i 70)
+ (loop
(sleep (random 1d0))
(interrupt-thread c
(lambda ()
;; overall exit status is 0, not 104
(sleep 2)
-(sb-ext:quit :unix-status 104)
+;(sb-ext:quit :unix-status 104)
;;; with something arbitrary in the fourth field, is used for CVS
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
-"0.8.3.9"
+;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
+"0.8.3.10"