Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharley Wang2009-10-05 16:04:54 +0000
committerCharley Wang2009-10-05 16:04:54 +0000
commitc3fa56ffb7b86365eab1c5ff5cf21168c21676fa (patch)
tree1dd7585b5a0873ff4d04a16a1a385424c5129f97 /systemtap/org.eclipse.linuxtools.callgraph.core/src/org/eclipse/linuxtools/callgraph/core/SystemTapParser.java
parentd9f35df4dd4123f871d96957c2fda901e487d032 (diff)
downloadorg.eclipse.linuxtools-c3fa56ffb7b86365eab1c5ff5cf21168c21676fa.tar.gz
org.eclipse.linuxtools-c3fa56ffb7b86365eab1c5ff5cf21168c21676fa.tar.xz
org.eclipse.linuxtools-c3fa56ffb7b86365eab1c5ff5cf21168c21676fa.zip
Added isJobCancelled() call to SystemTapParser, so the Delegate can terminate early if the user has cancelled the RunTimeJob
Diffstat (limited to 'systemtap/org.eclipse.linuxtools.callgraph.core/src/org/eclipse/linuxtools/callgraph/core/SystemTapParser.java')
-rw-r--r--systemtap/org.eclipse.linuxtools.callgraph.core/src/org/eclipse/linuxtools/callgraph/core/SystemTapParser.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/systemtap/org.eclipse.linuxtools.callgraph.core/src/org/eclipse/linuxtools/callgraph/core/SystemTapParser.java b/systemtap/org.eclipse.linuxtools.callgraph.core/src/org/eclipse/linuxtools/callgraph/core/SystemTapParser.java
index 57d95521fd..96e1bdc788 100644
--- a/systemtap/org.eclipse.linuxtools.callgraph.core/src/org/eclipse/linuxtools/callgraph/core/SystemTapParser.java
+++ b/systemtap/org.eclipse.linuxtools.callgraph.core/src/org/eclipse/linuxtools/callgraph/core/SystemTapParser.java
@@ -360,11 +360,24 @@ public abstract class SystemTapParser extends Job {
}
/**
- * Cancels the RunTimeJob affiliated with this parser.
+ * Cancels the RunTimeJob affiliated with this parser. Returns the result
+ * of job.cancel() if job is not null, or false if job is null.
*/
- public void cancelJob() {
+ public boolean cancelJob() {
if (job != null)
job.cancel();
+ return false;
+ }
+
+ /**
+ * Returns true if job is not null and the job's last result was CANCEL_STATUS.
+ * False otherwise.
+ */
+ public boolean isJobCancelled() {
+ if (job != null && job.getResult() == Status.CANCEL_STATUS) {
+ return true;
+ }
+ return false;
}

Back to the top