1.0.6.37: thread safety test for the CLOS cache
[sbcl.git] / tests / deadline.impure.lisp
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))))