Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Tasse2015-01-26 22:25:45 +0000
committerPatrick Tasse2015-01-28 15:25:36 +0000
commit6f58a301ad8247ea5ff45e7d96b701626dc73799 (patch)
tree2dc3614820dc312fe6ffb863d273fbcb927802e8
parent5328e7e5693e65c60cdbd80b9cfa5e514675dd03 (diff)
downloadorg.eclipse.linuxtools-6f58a301ad8247ea5ff45e7d96b701626dc73799.tar.gz
org.eclipse.linuxtools-6f58a301ad8247ea5ff45e7d96b701626dc73799.tar.xz
org.eclipse.linuxtools-6f58a301ad8247ea5ff45e7d96b701626dc73799.zip
tmf: Bug 457109: Exit early in TmfEventThread if request is cancelled
Change-Id: I8daca3646b4a8aeb4f19acbe7bc6fc380f32e7c6 Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com> Reviewed-on: https://git.eclipse.org/r/40408 Tested-by: Hudson CI Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com> Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/component/TmfEventThread.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/component/TmfEventThread.java b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/component/TmfEventThread.java
index f15ebed8a8..419fb76369 100644
--- a/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/component/TmfEventThread.java
+++ b/lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/component/TmfEventThread.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012, 2013 Ericsson
+ * Copyright (c) 2012, 2015 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
@@ -9,6 +9,7 @@
* Contributors:
* Francois Chouinard - Initial API and implementation
* Bernd Hufmann - Update handling of suspend and resume
+ * Patrick Tasse - Exit early if request is cancelled
*******************************************************************************/
package org.eclipse.linuxtools.internal.tmf.core.component;
@@ -159,15 +160,20 @@ public class TmfEventThread implements Runnable {
TmfCoreTracer.traceRequest(fRequest, "is being serviced by " + fProvider.getName()); //$NON-NLS-1$
+ if (fRequest.isCancelled()) {
+ isCompleted = true;
+ return;
+ }
+
// Extract the generic information
fRequest.start();
int nbRequested = fRequest.getNbRequested();
int nbRead = 0;
- isCompleted = false;
// Initialize the execution
ITmfContext context = fProvider.armRequest(fRequest);
if (context == null) {
+ isCompleted = true;
fRequest.cancel();
return;
}
@@ -212,6 +218,7 @@ public class TmfEventThread implements Runnable {
} catch (Exception e) {
Activator.logError("Error in " + fProvider.getName() + " handling " + fRequest, e); //$NON-NLS-1$ //$NON-NLS-2$
+ isCompleted = true;
fRequest.fail();
}

Back to the top