Skip to content
This repository was archived by the owner on Apr 25, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/clj/clojure/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1531,11 +1531,15 @@
{:added "1.0"}
[x & body]
`(let [lockee# ~x]
(monitor-enter lockee#)
(try
~@body
(finally
(monitor-exit lockee#)))))
(monitor-enter lockee#)
(try
~@body
(finally
(try
(monitor-exit lockee#)
(catch Exception e# (throw (RuntimeException. (str "Failed to release the lock on " lockee#) e#))))))
(catch Exception e# (throw (RuntimeException. (str "Could not obtain a lock on " lockee#) e#))))))

(defmacro ..
"form => fieldName-symbol or (instanceMethodName-symbol args*)
Expand Down