+(with-test (:name (:with-recursive-lock :wait-p))
+ (let ((m (make-mutex)))
+ (with-mutex (m)
+ (assert (null (join-thread (make-thread
+ (lambda ()
+ (with-recursive-lock (m :wait-p nil)
+ t)))))))
+ (assert (join-thread (make-thread
+ (lambda ()
+ (with-recursive-lock (m :wait-p nil)
+ t)))))))
+
+(with-test (:name (:with-recursive-lock :wait-p :recursive))
+ (let ((m (make-mutex)))
+ (assert (join-thread (make-thread
+ (lambda ()
+ (with-recursive-lock (m :wait-p nil)
+ (with-recursive-lock (m :wait-p nil)
+ t))))))))
+
+(with-test (:name (:with-recursive-lock :timeout))
+ (let ((m (make-mutex)))
+ (with-mutex (m)
+ (assert (null (join-thread (make-thread
+ (lambda ()
+ (with-recursive-lock (m :timeout 0.1)
+ t)))))))
+ (assert (join-thread (make-thread
+ (lambda ()
+ (with-recursive-lock (m :timeout 0.1)
+ t)))))))
+
+(with-test (:name (:with-recursive-lock :timeout :recursive))
+ (let ((m (make-mutex)))
+ (assert (join-thread (make-thread
+ (lambda ()
+ (with-recursive-lock (m :timeout 0.1)
+ (with-recursive-lock (m :timeout 0.1)
+ t))))))))
+