mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-25 21:43:49 +00:00
started work on bug3195 with a few FIXME comments
This commit is contained in:
1 parent
d73157ca9d
commit
2b12ef4c51
1 file changed
+2
-2
+2
-2
@@ -49,7 +49,7 @@ public class ShortTimeWindCache {
|
|||||||
public void run() {
|
public void run() {
|
||||||
long oldestToKeep = System.currentTimeMillis() - preserveHowManyMilliseconds;
|
long oldestToKeep = System.currentTimeMillis() - preserveHowManyMilliseconds;
|
||||||
Pair<Long, Triple<Position, TimePoint, Set<WindSource>>> next;
|
Pair<Long, Triple<Position, TimePoint, Set<WindSource>>> next;
|
||||||
while ((next = order.pollFirst()) != null && next.getA() < oldestToKeep) {
|
while ((next = order.pollFirst()) != null && next.getA() < oldestToKeep) { // FIXME don't poll, peek; otherwise if next.getA() >= oldestToKeep then order and cache run inconsistent
|
||||||
cache.remove(next.getB());
|
cache.remove(next.getB());
|
||||||
}
|
}
|
||||||
synchronized (order) {
|
synchronized (order) {
|
||||||
@@ -71,7 +71,7 @@ public class ShortTimeWindCache {
|
|||||||
|
|
||||||
private void add(Triple<Position, TimePoint, Set<WindSource>> key, WindWithConfidence<com.sap.sse.common.Util.Pair<Position, TimePoint>> wind) {
|
private void add(Triple<Position, TimePoint, Set<WindSource>> key, WindWithConfidence<com.sap.sse.common.Util.Pair<Position, TimePoint>> wind) {
|
||||||
cache.put(key, wind);
|
cache.put(key, wind);
|
||||||
boolean orderEmpty = order.isEmpty();
|
boolean orderEmpty = order.isEmpty(); // FIXME this should check for timer running or be put into the synchronized block
|
||||||
synchronized (order) {
|
synchronized (order) {
|
||||||
order.add(new Pair<Long, Triple<Position, TimePoint, Set<WindSource>>>(System.currentTimeMillis(), key));
|
order.add(new Pair<Long, Triple<Position, TimePoint, Set<WindSource>>>(System.currentTimeMillis(), key));
|
||||||
if (orderEmpty) {
|
if (orderEmpty) {
|
||||||
|
|||||||
Reference in new issue
Block a user