1.0.5.29: fix a race-condition in deadline.impure.lisp
authorNikodemus Siivola <nikodemus@random-state.net>
Fri, 4 May 2007 09:21:40 +0000 (09:21 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 4 May 2007 09:21:40 +0000 (09:21 +0000)
 * The thread that is supposed to hold the mutex might no yet have
   grabbed it.

tests/deadline.impure.lisp
version.lisp-expr

index 32d19f6..9d0b4f9 100644 (file)
 #+(and sb-thread (not sb-lutex))
 (progn
   (assert-timeout
-   (let ((lock (sb-thread:make-mutex)))
-     (sb-thread:make-thread (lambda () (sb-thread:get-mutex lock) (sleep 5)))
+   (let ((lock (sb-thread:make-mutex))
+         (waitp t))
+     (sb-thread:make-thread (lambda ()
+                              (sb-thread:get-mutex lock)
+                              (setf waitp nil)
+                              (sleep 5)))
+     (loop while waitp do (sleep 0.01))
      (sb-impl::with-deadline (:seconds 1)
        (sb-thread:get-mutex lock))))
 
index 3c913a2..879aca9 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.5.28"
+"1.0.5.29"