Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2016-07-07 14:52:25 +0000
committerChristian W. Damus2016-07-07 19:06:18 +0000
commitba91f9a9474a13168b554ba5d9f83fa8d2ca1d8c (patch)
treeb2ea47432ed39adf3a13c9bfe24e9d4a9e34c4f1 /plugins/infra/emf
parent367ab9a3ccaee8df6caba293875d27197d836b34 (diff)
downloadorg.eclipse.papyrus-ba91f9a9474a13168b554ba5d9f83fa8d2ca1d8c.tar.gz
org.eclipse.papyrus-ba91f9a9474a13168b554ba5d9f83fa8d2ca1d8c.tar.xz
org.eclipse.papyrus-ba91f9a9474a13168b554ba5d9f83fa8d2ca1d8c.zip
Bug 497497: WorkspaceModelIndex doesn't limit number of jobs
https://bugs.eclipse.org/bugs/show_bug.cgi?id=497497 (cherry-picked from streams/2.0-maintenance) Ensure that there is only one pool of job allocations by not creating new semaphores for those allocations on every run of the job wrangler. Change-Id: Icd8b400361c57ce72617c5dae5eb537bcfe450b1
Diffstat (limited to 'plugins/infra/emf')
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/pom.xml2
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java5
3 files changed, 4 insertions, 5 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF
index 41dc0ae451c..eb599b54ca7 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/META-INF/MANIFEST.MF
@@ -15,7 +15,7 @@ Require-Bundle: org.eclipse.papyrus.infra.core;bundle-version="[2.0.0,3.0.0)";vi
org.eclipse.papyrus.emf.facet.custom.core;bundle-version="[2.0.0,3.0.0)";visibility:=reexport
Bundle-Vendor: Eclipse Modeling Project
Bundle-ActivationPolicy: lazy
-Bundle-Version: 2.0.0.qualifier
+Bundle-Version: 2.0.100.qualifier
Bundle-Name: EMF Tools
Bundle-Activator: org.eclipse.papyrus.infra.emf.Activator
Bundle-ManifestVersion: 2
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/pom.xml b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/pom.xml
index afbd61aedc8..4f142a8b4fe 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/pom.xml
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/pom.xml
@@ -7,6 +7,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.emf</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.0.100-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java
index 45e6ba795b6..98e6b063472 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java
@@ -596,12 +596,12 @@ public class WorkspaceModelIndex<T> {
private final Deque<AbstractIndexJob> queue = Queues.newArrayDeque();
private final AtomicBoolean active = new AtomicBoolean();
- private final int maxConcurrentJobs;
+ private final Semaphore indexJobSemaphore;
JobWrangler(int maxConcurrentJobs) {
super("Workspace model indexer", null);
- this.maxConcurrentJobs = maxConcurrentJobs;
+ indexJobSemaphore = new Semaphore((maxConcurrentJobs <= 0) ? Integer.MAX_VALUE : maxConcurrentJobs);
}
@Override
@@ -641,7 +641,6 @@ public class WorkspaceModelIndex<T> {
@Override
protected IStatus doRun(IProgressMonitor progressMonitor) {
- final Semaphore indexJobSemaphore = new Semaphore((maxConcurrentJobs <= 0) ? Integer.MAX_VALUE : maxConcurrentJobs);
final AtomicInteger pending = new AtomicInteger(); // How many permits have we issued?
final Condition pendingChanged = lock.newCondition();

Back to the top