[grid] Wrap reading the model in a read lock
@@ -245,6 +245,12 @@ public void refresh() {
@Override
protected Set<Host> getModel() {
+ Lock readLock = this.lock.readLock();
+ readLock.lock();
+ try {
return ImmutableSet.copyOf(hosts);
+ } finally {
+ readLock.unlock();
+ }
}
}
