(defvar *threads-to-kill*)
(defvar *threads-to-join*)
+(eval-when (:compile-toplevel :load-toplevel :execute)
+ (require :sb-posix))
+
+(sb-posix:putenv (format nil "SBCL_MACHINE_TYPE=~A" (machine-type)))
+(sb-posix:putenv (format nil "SBCL_SOFTWARE_TYPE=~A" (software-type)))
+
#+sb-thread
(defun make-kill-thread (&rest args)
(let ((thread (apply #'sb-thread:make-thread args)))
&body body)
(let ((block-name (gensym))
#+sb-thread (threads (gensym "THREADS")))
+ (flet ((name-ok (x y)
+ (declare (ignore y))
+ (typecase x
+ (symbol (let ((package (symbol-package x)))
+ (or (null package)
+ (eql package (find-package "CL"))
+ (eql package (find-package "KEYWORD"))
+ (eql (mismatch "SB-" (package-name package)) 3))))
+ (integer t))))
+ (unless (tree-equal name name :test #'name-ok)
+ (error "test name must be all-keywords: ~S" name)))
`(progn
(start-test)
(cond
(unless (or (not (sb-thread:thread-alive-p thread))
(eql thread sb-thread:*current-thread*)
(member thread ,threads)
- (sb-thread:thread-emphemeral-p thread))
+ (sb-thread:thread-ephemeral-p thread))
(setf any-leftover thread)
(ignore-errors (sb-thread:terminate-thread thread))))
(when any-leftover
(defun skipped-p (skipped-on)
(sb-impl::featurep skipped-on))
-(defun test-env ()
- (cons (format nil "SBCL_MACHINE_TYPE=~A" (machine-type))
- (cons (format nil "SBCL_SOFTWARE_TYPE=~A" (software-type))
- (posix-environ))))
-
;;; Repeat calling THUNK until its cumulated runtime, measured using
;;; GET-INTERNAL-RUN-TIME, is larger than PRECISION. Repeat this
;;; REPETITIONS many times and return the time one call to THUNK took