Commit 41c15f20 authored by Phillip Webb's avatar Phillip Webb

Polish concurrent gaugeLocks map access

See gh-1995
parent b519eda4
......@@ -103,8 +103,9 @@ public class CodahaleMetricWriter implements MetricWriter {
private Object getGuageLock(String name) {
Object lock = this.gaugeLocks.get(name);
if (lock == null) {
this.gaugeLocks.putIfAbsent(name, new Object());
lock = this.gaugeLocks.get(name);
Object newLock = new Object();
lock = this.gaugeLocks.putIfAbsent(name, newLock);
lock = (lock == null ? newLock : lock);
}
return lock;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment