Commit 237defaf authored by Phillip Webb's avatar Phillip Webb

Merge branch '1.1.x'

parents 53637eaa 41c15f20
...@@ -103,8 +103,9 @@ public class CodahaleMetricWriter implements MetricWriter { ...@@ -103,8 +103,9 @@ public class CodahaleMetricWriter implements MetricWriter {
private Object getGuageLock(String name) { private Object getGuageLock(String name) {
Object lock = this.gaugeLocks.get(name); Object lock = this.gaugeLocks.get(name);
if (lock == null) { if (lock == null) {
this.gaugeLocks.putIfAbsent(name, new Object()); Object newLock = new Object();
lock = this.gaugeLocks.get(name); lock = this.gaugeLocks.putIfAbsent(name, newLock);
lock = (lock == null ? newLock : lock);
} }
return 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