From: Christophe Rhodes Date: Thu, 7 Aug 2003 10:38:32 +0000 (+0000) Subject: 0.8.2.20: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=f6c58711c58ee05502fefc6c176a2533b18021bb;p=sbcl.git 0.8.2.20: Fix to WITH-TIMEOUT (Stig Sandoe sbcl-devel 2003-07-30) ... more than one form now permissible in body. ... don't change the interface (yet); I can't think of a backward-compatible way. --- diff --git a/NEWS b/NEWS index 3f784b0..d43a6a3 100644 --- a/NEWS +++ b/NEWS @@ -1958,6 +1958,8 @@ changes in sbcl-0.8.3 relative to sbcl-0.8.2: printable. (reported by Eric Marsden) * bug fix in sb-posix: mmap() now works on systems with a 64-bit off_t, including Darwin and FreeBSD. (thanks to Andreas Fuchs) + * bug fix in WITH-TIMEOUT: now the body can have more than one form. + (thanks to Stig Sandoe) * fixed some bugs revealed by Paul Dietz' test suite: ** The system now obeys the constraint imposed by UPGRADED-ARRAY-ELEMENT-TYPE that the upgraded array element diff --git a/src/code/unix.lisp b/src/code/unix.lisp index adc5efc..9199ccb 100644 --- a/src/code/unix.lisp +++ b/src/code/unix.lisp @@ -759,7 +759,7 @@ (slot (slot itvo 'it-value) 'tv-usec)) which (alien-sap (addr itvn))(alien-sap (addr itvo)))))) -(defmacro sb!ext::with-timeout (expires &body body) +(defmacro sb!ext:with-timeout (expires &body body) "Execute the body, interrupting it with a SIGALRM after at least EXPIRES seconds have passed. Uses Unix setitimer(), restoring any previous timer after the body has finished executing" @@ -779,8 +779,8 @@ previous timer after the body has finished executing" (unix-setitimer :real 0 0 ,s ,u) ,@body) (unix-setitimer :real 0 0 ,saved-seconds ,saved-useconds)) - ,@body))))) - + (progn + ,@body)))))) (defconstant ENOENT 2) ; Unix error code, "No such file or directory" diff --git a/tests/interface.pure.lisp b/tests/interface.pure.lisp index c69e03e..f329d03 100644 --- a/tests/interface.pure.lisp +++ b/tests/interface.pure.lisp @@ -98,3 +98,9 @@ ;;; DECLARE should not be a special operator (assert (not (special-operator-p 'declare))) + +;;; WITH-TIMEOUT should accept more than one form in its body. +(handler-bind ((sb-ext:timeout #'continue)) + (sb-ext:with-timeout 3 + (sleep 2) + (sleep 2))) diff --git a/version.lisp-expr b/version.lisp-expr index c86a176..4fbbb0c 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.2.19" +"0.8.2.20"