3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
12 (in-package :sb-concurrency-test)
17 (defparameter +timeout+ 30.0)
19 (defun make-threads (n name fn)
20 (loop for i from 1 to n
21 collect (make-thread fn :name (format nil "~A-~D" name i))))
23 (defun timed-join-thread (thread &optional (timeout +timeout+))
24 (handler-case (sb-sys:with-deadline (:seconds timeout)
25 (join-thread thread :default :aborted))
30 (join-thread *current-thread*))
32 (defun kill-thread (thread)
33 (when (thread-alive-p thread)
35 (terminate-thread thread))))
37 ) ;; #+sb-thread (progn ...