X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=org.eclipse.linuxtools.tmf.core%2Fsrc%2Forg%2Feclipse%2Flinuxtools%2Ftmf%2Fcore%2Fctfadaptor%2FCtfIterator.java;h=8311e7acb8fc351abd3183feab786cb491110e6f;hb=b6220b93a649a550ce808b03d2b5e180d3a83e57;hp=b5d6c8f22f611a95fbdff718c010fc7ceaef9969;hpb=112523422233867587c313bdc26b21bde93931d0;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIterator.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIterator.java index b5d6c8f22f..8311e7acb8 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIterator.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIterator.java @@ -101,7 +101,7 @@ public class CtfIterator extends CTFTraceReader implements ITmfContext, * @return CtfTmfEvent */ public CtfTmfEvent getCurrentEvent() { - final StreamInputReader top = super.prio.peek(); + final StreamInputReader top = super.getPrio().peek(); if (top != null) { return CtfTmfEventFactory.createEvent(top.getCurrentEvent(), top.getFilename(), ctfTmfTrace); @@ -122,7 +122,7 @@ public class CtfIterator extends CTFTraceReader implements ITmfContext, * @return boolean * @since 2.0 */ - public boolean seek(final CtfLocationInfo ctfLocationData) { + public synchronized boolean seek(final CtfLocationInfo ctfLocationData) { boolean ret = false; /* Adjust the timestamp depending on the trace's offset */ @@ -139,11 +139,12 @@ public class CtfIterator extends CTFTraceReader implements ITmfContext, * assign the location index correctly */ long index = 0; - if (this.getCurrentEvent() != null) { - currTimestamp = this.getCurrentEvent().getTimestamp().getValue(); + final CtfTmfEvent currentEvent = this.getCurrentEvent(); + if (currentEvent != null) { + currTimestamp = currentEvent.getTimestamp().getValue(); for (long i = 0; i < ctfLocationData.getIndex(); i++) { - if (currTimestamp == this.getCurrentEvent().getTimestamp().getValue()) { + if (currTimestamp == currentEvent.getTimestamp().getValue()) { index++; } else { index = 0; @@ -246,7 +247,7 @@ public class CtfIterator extends CTFTraceReader implements ITmfContext, * @return boolean successful or not */ @Override - public boolean advance() { + public synchronized boolean advance() { long index = curLocation.getLocationInfo().getIndex(); long timestamp = curLocation.getLocationInfo().getTimestamp(); boolean ret = super.advance();