diff options
author | Bernd Hufmann | 2012-11-29 16:40:27 +0000 |
---|---|---|
committer | Bernd Hufmann | 2012-11-30 14:54:54 +0000 |
commit | 75128abc752815183062693e4d595fc480c64e0c (patch) | |
tree | 9e7053d2e0961330fa2772c7146e17e04bdc21da | |
parent | 48212066c25ab1556763d85708cbd7e85bf1dcac (diff) | |
download | org.eclipse.linuxtools-75128abc752815183062693e4d595fc480c64e0c.tar.gz org.eclipse.linuxtools-75128abc752815183062693e4d595fc480c64e0c.tar.xz org.eclipse.linuxtools-75128abc752815183062693e4d595fc480c64e0c.zip |
Handle concurrent seek and dispose in CtfTmfTrace properly
Change-Id: I097f7f062e5c301fe9f00bab52f709b7afebb376
Reviewed-on: https://git.eclipse.org/r/8938
Tested-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
IP-Clean: Patrick Tasse <patrick.tasse@gmail.com>
-rw-r--r-- | lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java index d8a35d8cfa..f1b6427a27 100644 --- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java +++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java @@ -166,9 +166,14 @@ public class CtfTmfTrace extends TmfTrace implements ITmfEventParser { * @return ITmfContext */ @Override - public ITmfContext seekEvent(final ITmfLocation location) { + public synchronized ITmfContext seekEvent(final ITmfLocation location) { CtfLocation currentLocation = (CtfLocation) location; CtfTmfLightweightContext context = new CtfTmfLightweightContext(this); + if (fTrace == null) { + context.setLocation(null); + context.setRank(ITmfContext.UNKNOWN_RANK); + return context; + } /* * The rank is set to 0 if the iterator seeks the beginning. If not, it * will be set to UNKNOWN_RANK, since CTF traces don't support seeking @@ -196,8 +201,13 @@ public class CtfTmfTrace extends TmfTrace implements ITmfEventParser { @Override - public ITmfContext seekEvent(double ratio) { + public synchronized ITmfContext seekEvent(double ratio) { CtfTmfLightweightContext context = new CtfTmfLightweightContext(this); + if (fTrace == null) { + context.setLocation(null); + context.setRank(ITmfContext.UNKNOWN_RANK); + return context; + } final long end = this.getEndTime().getValue(); final long start = this.getStartTime().getValue(); final long diff = end - start; |