0.8.2.20:
authorChristophe Rhodes <csr21@cam.ac.uk>
Thu, 7 Aug 2003 10:38:32 +0000 (10:38 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Thu, 7 Aug 2003 10:38:32 +0000 (10:38 +0000)
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.

NEWS
src/code/unix.lisp
tests/interface.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 3f784b0..d43a6a3 100644 (file)
--- 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
index adc5efc..9199ccb 100644 (file)
                        (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))))))
 \f
 
 (defconstant ENOENT 2) ; Unix error code, "No such file or directory"
index c69e03e..f329d03 100644 (file)
@@ -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)))
index c86a176..4fbbb0c 100644 (file)
@@ -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"