     (wcar* (car/watch lock-key)
            (if (= identifier (car/get lock-key))
              (car/del lock-key)
-             (car/unwatch lock-key)))))
+             (car/unwatch)))))
 
 ;; Listing 6.9: The purchase_item_with_lock() function
 

               acquire-timeout)]
    (loop []
      (cond
        (< end (ctc/to-long (ct/now))) false
        (= 1 (wcar* (car/setnx (str "lock:" lockname) identifier))) (do (wcar* (car/expire (str "lock:" lockname) lock-timeout))
                                                                        identifier)
        :else (do (Thread/sleep 100)
                  (recur))))))

    (when lock-identifier
      (release-lock "market" lock-identifier))))

;; Listing 6.11: The acquire_lock_with_timeout() function

(defn acquire-lock-with-timeout
