                        (.lock pool)
                        (deliver lock-thread-locked? true)
                        @unlock?
-                       (.unlock pool))]
+                       (.unlock pool)
+                       true)]
       @lock-thread-started?
       (.releaseItem pool borrow-1)
-      @lock-thread-locked?
-      (is (.isLocked pool))
+      (is (true? (timed-deref lock-thread-locked?))
+          "timed out waiting for the lock to be acquired")
+      (is (true? (.isLocked pool)))
       ;; Interrupt the second borrow thread so that it will stop waiting for the
       ;; pool to be not empty and not locked.
       (.interrupt borrow-thread-obj-2)
-      (is (thrown? ExecutionException @borrow-thread-2)
+      (is (thrown? ExecutionException (timed-deref borrow-thread-2))
           "second borrow could not be interrupted")
       (is (not (realized? borrow-thread-3)))
       (deliver unlock? true)
-      @lock-thread
+      (is (true? (timed-deref lock-thread))
+          "timed out waiting for the lock thread to finish")
       (is (not (.isLocked pool)))
       ;; If the third borrow doesn't block indefinitely, we've confirmed that
       ;; the interruption of the second borrow while the write lock was
       ;; held did not adversely affect the ability of the third borrow call
       ;; to return.
-      (is (identical? borrow-1 @borrow-thread-3)
+      (is (identical? borrow-1 (timed-deref borrow-thread-3))
           (str "did not get back the same instance from the third borrow"
                "attempt as was returned from the first borrow attempt")))))
 

                       (.lock pool)
                       (deliver lock-thread-locked? true)
                       @unlock?
                       (.unlock pool))]
      @lock-thread-started?
      (.releaseItem pool borrow-1)
      @lock-thread-locked?
      (is (.isLocked pool))
      (is (nil? @borrow-thread-2)
          "second borrow attempt did not time out")
      (deliver unlock? true)
      @lock-thread
      (is (not (.isLocked pool)))
      (is (identical? borrow-1 @borrow-thread-3)
          (str "did not get back the same instance from the third borrow"
               "attempt as was returned from the first borrow attempt")))))


            borrow-thread-1 (future (deliver borrow-thread-started-1? true)
                                    (let [instance (.borrowItem pool)]
                                      (deliver borrow-thread-borrowed-1? true)
                                      (.releaseItem pool instance))
                                    true)
            borrow-thread-2 (future (deliver borrow-thread-started-2? true)
                                    (let [instance (.borrowItem pool)]
                                      (deliver borrow-thread-borrowed-2? true)
                                      (.releaseItem pool instance))
                                    true)]
        @borrow-thread-started-1?
        @borrow-thread-started-2?
        (is (not (realized? borrow-thread-borrowed-1?)))
