Changeset 10891 in josm
- Timestamp:
- 2016-08-24T23:06:18+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r10809 r10891 1161 1161 if (updateCount > 0) { 1162 1162 updateCount--; 1163 List<AbstractDatasetChangedEvent> eventsToFire = Collections.emptyList(); 1163 1164 if (updateCount == 0) { 1164 List<AbstractDatasetChangedEvent> eventsCopy= new ArrayList<>(cachedEvents);1165 eventsToFire = new ArrayList<>(cachedEvents); 1165 1166 cachedEvents.clear(); 1167 } 1168 1169 if (!eventsToFire.isEmpty()) { 1170 lock.readLock().lock(); 1166 1171 lock.writeLock().unlock(); 1167 1168 if (!eventsCopy.isEmpty()) { 1169 lock.readLock().lock(); 1170 try { 1171 if (eventsCopy.size() < MAX_SINGLE_EVENTS) { 1172 for (AbstractDatasetChangedEvent event: eventsCopy) { 1173 fireEventToListeners(event); 1174 } 1175 } else if (eventsCopy.size() == MAX_EVENTS) { 1176 fireEventToListeners(new DataChangedEvent(this)); 1177 } else { 1178 fireEventToListeners(new DataChangedEvent(this, eventsCopy)); 1172 try { 1173 if (eventsToFire.size() < MAX_SINGLE_EVENTS) { 1174 for (AbstractDatasetChangedEvent event: eventsToFire) { 1175 fireEventToListeners(event); 1179 1176 } 1180 } finally { 1181 lock.readLock().unlock(); 1177 } else if (eventsToFire.size() == MAX_EVENTS) { 1178 fireEventToListeners(new DataChangedEvent(this)); 1179 } else { 1180 fireEventToListeners(new DataChangedEvent(this, eventsToFire)); 1182 1181 } 1182 } finally { 1183 lock.readLock().unlock(); 1183 1184 } 1184 1185 } else {
Note:
See TracChangeset
for help on using the changeset viewer.