X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-concurrency%2Ftests%2Ftest-utils.lisp;h=a6e441490e48bbe305fa748023dbed42a17186fa;hb=ab5427d31da2bd95805cccc8e47b8f43d3dd606d;hp=6a5e82a939a8ec425b78fa4657f0949a142951f0;hpb=ea0735f0b8bab352d6c9797abec19e8c63563cf6;p=sbcl.git diff --git a/contrib/sb-concurrency/tests/test-utils.lisp b/contrib/sb-concurrency/tests/test-utils.lisp index 6a5e82a..a6e4414 100644 --- a/contrib/sb-concurrency/tests/test-utils.lisp +++ b/contrib/sb-concurrency/tests/test-utils.lisp @@ -1,17 +1,30 @@ +;;;; -*- Lisp -*- +;;;; +;;;; This software is part of the SBCL system. See the README file for +;;;; more information. +;;;; +;;;; This software is derived from the CMU CL system, which was +;;;; written at Carnegie Mellon University and released into the +;;;; public domain. The software is in the public domain and is +;;;; provided with absolutely no warranty. See the COPYING and CREDITS +;;;; files for more information. + (in-package :sb-concurrency-test) #+sb-thread (progn -(defparameter +timeout+ 60.0) +(defparameter +timeout+ 30.0) (defun make-threads (n name fn) (loop for i from 1 to n collect (make-thread fn :name (format nil "~A-~D" name i)))) (defun timed-join-thread (thread &optional (timeout +timeout+)) - (sb-sys:with-deadline (:seconds timeout) - (join-thread thread :default :aborted))) + (handler-case (sb-sys:with-deadline (:seconds timeout) + (join-thread thread :default :aborted)) + (sb-ext:timeout () + :timeout))) (defun hang () (join-thread *current-thread*)) @@ -21,4 +34,4 @@ (ignore-errors (terminate-thread thread)))) -) ;; #+sb-thread (progn ... \ No newline at end of file +) ;; #+sb-thread (progn ...