1.0.34.2: Make threads.pure.lisp symbol-value-in-thread.[78] tests more reliable.
authorAlastair Bridgewater <lisphacker@users.sourceforge.net>
Wed, 30 Dec 2009 22:54:27 +0000 (22:54 +0000)
committerAlastair Bridgewater <lisphacker@users.sourceforge.net>
Wed, 30 Dec 2009 22:54:27 +0000 (22:54 +0000)
  * Actually assert that an error occurred (setf won't signal an
unbound-variable if the thread still lives).

  * Join the thread before attempting to access the value (no more race
condition).

tests/threads.pure.lisp
version.lisp-expr

index 8bfeea8..bc2b94c 100644 (file)
 
 #+sb-thread
 (with-test (:name symbol-value-in-thread.7)
-  (let ((child (make-thread (lambda ()))))
+  (let ((child (make-thread (lambda ())))
+        (error-occurred nil))
+    (join-thread child)
     (handler-case
         (symbol-value-in-thread 'this-is-new child)
       (symbol-value-in-thread-error (e)
+        (setf error-occurred t)
         (assert (eq child (thread-error-thread e)))
         (assert (eq 'this-is-new (cell-error-name e)))
         (assert (equal (list :read :thread-dead)
-                       (sb-thread::symbol-value-in-thread-error-info e)))))))
+                       (sb-thread::symbol-value-in-thread-error-info e)))))
+    (assert error-occurred)))
 
 #+sb-thread
 (with-test (:name symbol-value-in-thread.8)
-  (let ((child (make-thread (lambda ()))))
+  (let ((child (make-thread (lambda ())))
+        (error-occurred nil))
+    (join-thread child)
     (handler-case
         (setf (symbol-value-in-thread 'this-is-new child) t)
       (symbol-value-in-thread-error (e)
+        (setf error-occurred t)
         (assert (eq child (thread-error-thread e)))
         (assert (eq 'this-is-new (cell-error-name e)))
         (assert (equal (list :write :thread-dead)
-                       (sb-thread::symbol-value-in-thread-error-info e)))))))
+                       (sb-thread::symbol-value-in-thread-error-info e)))))
+    (assert error-occurred)))
index ec1203b..f5b67bc 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".)
-"1.0.34.1"
+"1.0.34.2"