Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2008-12-07 20:36:46 +0000
committerDoug Schaefer2008-12-07 20:36:46 +0000
commit39dc95b0e60410780395ca212afd7ec10d7f70f9 (patch)
tree2e264a4496c90b458c4c9c7270d5f396e9f9f054 /p2/org.eclipse.cdt.p2
parentd7367d54be4db2486ea682de1a055e0966224e7c (diff)
downloadorg.eclipse.cdt-39dc95b0e60410780395ca212afd7ec10d7f70f9.tar.gz
org.eclipse.cdt-39dc95b0e60410780395ca212afd7ec10d7f70f9.tar.xz
org.eclipse.cdt-39dc95b0e60410780395ca212afd7ec10d7f70f9.zip
Fix up any synchronization issues we may get with multiple threads.
Diffstat (limited to 'p2/org.eclipse.cdt.p2')
-rw-r--r--p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/p2/internal/repo/artifact/InstallArtifactRepository.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/p2/internal/repo/artifact/InstallArtifactRepository.java b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/p2/internal/repo/artifact/InstallArtifactRepository.java
index fe5f16fdc5f..50ddd518c70 100644
--- a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/p2/internal/repo/artifact/InstallArtifactRepository.java
+++ b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/p2/internal/repo/artifact/InstallArtifactRepository.java
@@ -139,7 +139,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository {
}
@Override
- public boolean contains(IArtifactKey key) {
+ public synchronized boolean contains(IArtifactKey key) {
IArtifactDescriptor desc = artifacts.get(key.getId());
if (desc == null)
return false;
@@ -153,7 +153,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository {
}
@Override
- public IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key) {
+ public synchronized IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key) {
// we only have one artifact descriptor per key
IArtifactDescriptor desc = artifacts.get(key);
if (desc != null)
@@ -162,7 +162,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository {
}
@Override
- public IArtifactKey[] getArtifactKeys() {
+ public synchronized IArtifactKey[] getArtifactKeys() {
Collection<IArtifactDescriptor> descs = artifacts.values();
IArtifactKey[] keys = new IArtifactKey[descs.size()];
int i = 0;
@@ -192,7 +192,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository {
save();
}
- Collection<IArtifactDescriptor> getDescriptors() {
+ synchronized Collection<IArtifactDescriptor> getDescriptors() {
return artifacts.values();
}
@@ -265,7 +265,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository {
}
@Override
- public void removeAll() {
+ public synchronized void removeAll() {
super.removeAll();
for (String artifact : artifacts.keySet())
deleteFiles(artifact);
@@ -279,7 +279,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository {
}
@Override
- public void removeDescriptor(IArtifactKey key) {
+ public synchronized void removeDescriptor(IArtifactKey key) {
super.removeDescriptor(key);
deleteFiles(key.getId());
artifacts.remove(key);

Back to the top