Improved concurrency for RaceLogMappingWrapper

This commit is contained in:
Steffen Schaefer committed 2016-06-23 09:13:09 +02:00
1 parent c356f73552
commit 70573cf746
1 file changed
+4 -1
@@ -51,7 +51,10 @@ public abstract class RaceLogMappingWrapper<ItemT extends WithID> {
public void forEachMappingOfDeviceIncludingTimePoint(DeviceIdentifier device, TimePoint timePoint,
Consumer<DeviceMappingWithRegattaLogEvent<ItemT>> callback) {
List<DeviceMappingWithRegattaLogEvent<ItemT>> mappingsForDevice = getMappingsByDevice().get(device);
List<DeviceMappingWithRegattaLogEvent<ItemT>> mappingsForDevice;
synchronized (this) {
mappingsForDevice = mappingsByDevice.get(device);
}
if (mappingsForDevice != null) {
for (DeviceMappingWithRegattaLogEvent<ItemT> mapping : mappingsForDevice) {
if (mapping.getTimeRange().includes(timePoint)) {