mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-26 22:07:12 +00:00
Improved concurrency for RaceLogMappingWrapper
This commit is contained in:
1 parent
c356f73552
commit
70573cf746
1 file changed
+4
-1
+4
-1
@@ -51,7 +51,10 @@ public abstract class RaceLogMappingWrapper<ItemT extends WithID> {
|
|||||||
|
|
||||||
public void forEachMappingOfDeviceIncludingTimePoint(DeviceIdentifier device, TimePoint timePoint,
|
public void forEachMappingOfDeviceIncludingTimePoint(DeviceIdentifier device, TimePoint timePoint,
|
||||||
Consumer<DeviceMappingWithRegattaLogEvent<ItemT>> callback) {
|
Consumer<DeviceMappingWithRegattaLogEvent<ItemT>> callback) {
|
||||||
List<DeviceMappingWithRegattaLogEvent<ItemT>> mappingsForDevice = getMappingsByDevice().get(device);
|
List<DeviceMappingWithRegattaLogEvent<ItemT>> mappingsForDevice;
|
||||||
|
synchronized (this) {
|
||||||
|
mappingsForDevice = mappingsByDevice.get(device);
|
||||||
|
}
|
||||||
if (mappingsForDevice != null) {
|
if (mappingsForDevice != null) {
|
||||||
for (DeviceMappingWithRegattaLogEvent<ItemT> mapping : mappingsForDevice) {
|
for (DeviceMappingWithRegattaLogEvent<ItemT> mapping : mappingsForDevice) {
|
||||||
if (mapping.getTimeRange().includes(timePoint)) {
|
if (mapping.getTimeRange().includes(timePoint)) {
|
||||||
|
|||||||
Reference in new issue
Block a user