Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 114160 Details for
Bug 200997
[Progress] Can't seem to cancel jobs from ProgressView
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch fixing it on jobs level
job-canceling-patch.txt (text/plain), 2.97 KB, created by
Stephan Wahlbrink
on 2008-10-03 03:53:27 EDT
(
hide
)
Description:
Patch fixing it on jobs level
Filename:
MIME Type:
Creator:
Stephan Wahlbrink
Created:
2008-10-03 03:53:27 EDT
Size:
2.97 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.jobs >Index: src/org/eclipse/core/internal/jobs/JobManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/JobManager.java,v >retrieving revision 1.29 >diff -u -r1.29 JobManager.java >--- src/org/eclipse/core/internal/jobs/JobManager.java 14 Jul 2008 17:23:59 -0000 1.29 >+++ src/org/eclipse/core/internal/jobs/JobManager.java 2 Oct 2008 21:37:46 -0000 >@@ -235,6 +235,7 @@ > */ > protected boolean cancel(InternalJob job) { > IProgressMonitor monitor = null; >+ boolean runCanceling = false; > synchronized (lock) { > switch (job.getState()) { > case Job.NONE : >@@ -243,6 +244,10 @@ > //cannot cancel a job that has already started (as opposed to ABOUT_TO_RUN) > if (job.internalGetState() == Job.RUNNING) { > monitor = job.getProgressMonitor(); >+ runCanceling = !job.isRunCanceled(); >+ if (runCanceling) { >+ job.setRunCanceled(true); >+ } > break; > } > //signal that the job should be canceled before it gets a chance to run >@@ -252,10 +257,12 @@ > changeState(job, Job.NONE); > } > } >- //call monitor outside sync block >+ //call monitor and canceling outside sync block > if (monitor != null) { >- if (!monitor.isCanceled()) { >- monitor.setCanceled(true); >+ if (runCanceling) { >+ if (!monitor.isCanceled()) { >+ monitor.setCanceled(true); >+ } > job.canceling(); > } > return false; >Index: src/org/eclipse/core/internal/jobs/InternalJob.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.jobs/src/org/eclipse/core/internal/jobs/InternalJob.java,v >retrieving revision 1.9 >diff -u -r1.9 InternalJob.java >--- src/org/eclipse/core/internal/jobs/InternalJob.java 21 Feb 2008 23:50:10 -0000 1.9 >+++ src/org/eclipse/core/internal/jobs/InternalJob.java 2 Oct 2008 21:37:46 -0000 >@@ -47,6 +47,11 @@ > * flag on a job indicating that it was about to run, but has been canceled > */ > private static final int M_ABOUT_TO_RUN_CANCELED = 0x0400; >+ >+ /* >+ * flag on a job indicating that it was canceled when running >+ */ >+ private static final int M_RUN_CANCELED = 0x0800; > > protected static final JobManager manager = JobManager.getInstance(); > private static int nextJobNumber = 0; >@@ -288,6 +293,13 @@ > return (flags & M_ABOUT_TO_RUN_CANCELED) != 0; > } > >+ /** >+ * Returns whether this job was canceled when it was running >+ */ >+ final boolean isRunCanceled() { >+ return (flags & M_RUN_CANCELED) != 0; >+ } >+ > /* (non-Javadoc) > * @see Job#isBlocking() > */ >@@ -384,6 +396,13 @@ > > } > >+ /** >+ * Sets whether this job was canceled when it was running >+ */ >+ final void setRunCanceled(boolean value) { >+ flags = value ? flags | M_RUN_CANCELED : flags & ~M_RUN_CANCELED; >+ } >+ > /* (non-Javadoc) > * @see Job#setName(String) > */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
john.arthorne
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 200997
:
76826
|
114158
|
114160
|
114161
|
114221
|
114231
|
114258
|
114366