mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-05 20:03:52 +00:00
avoid deadlock when buoy listeners for cache invalidation for first
leg's direction are registered
This commit is contained in:
1 parent
a84e564df0
commit
d5cff509cc
2 files changed
+9
No files matched your search
@@ -25,6 +25,8 @@ public interface GPSFixTrack<ItemType, FixType extends GPSFix> extends Track<Fix
|
||||
*/
|
||||
void addListener(GPSTrackListener<ItemType> listener);
|
||||
|
||||
void removeListener(GPSTrackListener<ItemType> listener);
|
||||
|
||||
ItemType getTrackedItem();
|
||||
|
||||
/**
|
||||
|
||||
+7
@@ -53,6 +53,13 @@ public class GPSFixTrackImpl<ItemType, FixType extends GPSFix> extends TrackImpl
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeListener(GPSTrackListener<ItemType> listener) {
|
||||
synchronized (listeners) {
|
||||
listeners.remove(listener);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To iterate over the resulting listener list, synchronize on the iterable returned. Only this will avoid
|
||||
* {@link ConcurrentModificationException}s because listeners may be added on the fly, and this object will
|
||||
|
||||
Reference in new issue
Block a user