Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-10-22 14:39:59 +0000
committerslewis2007-10-22 14:39:59 +0000
commita565335c503eaf383c58da3326279e559abeee41 (patch)
treeabbc6ab95397135225259b9a3fe145aa67a2f9b2 /framework/bundles/org.eclipse.ecf.discovery
parent9ba10593cf1356255eb81c4fd8197e6874058997 (diff)
downloadorg.eclipse.ecf-a565335c503eaf383c58da3326279e559abeee41.tar.gz
org.eclipse.ecf-a565335c503eaf383c58da3326279e559abeee41.tar.xz
org.eclipse.ecf-a565335c503eaf383c58da3326279e559abeee41.zip
Added further synchronization support
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.discovery')
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/AbstractDiscoveryContainerAdapter.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/AbstractDiscoveryContainerAdapter.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/AbstractDiscoveryContainerAdapter.java
index 6fb44d8d5..81dcc6c34 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/AbstractDiscoveryContainerAdapter.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/AbstractDiscoveryContainerAdapter.java
@@ -73,7 +73,9 @@ public abstract class AbstractDiscoveryContainerAdapter extends AbstractContaine
public void addServiceTypeListener(IServiceTypeListener listener) {
if (listener == null)
return;
- serviceTypeListeners.add(listener);
+ synchronized (serviceTypeListeners) {
+ serviceTypeListeners.add(listener);
+ }
}
/*
@@ -129,7 +131,9 @@ public abstract class AbstractDiscoveryContainerAdapter extends AbstractContaine
public void removeServiceTypeListener(IServiceTypeListener listener) {
if (listener == null)
return;
- serviceTypeListeners.remove(listener);
+ synchronized (serviceTypeListeners) {
+ serviceTypeListeners.remove(listener);
+ }
}
/**
@@ -141,9 +145,11 @@ public abstract class AbstractDiscoveryContainerAdapter extends AbstractContaine
if (type == null || listener == null) {
return;
}
- final Collection v = (Collection) serviceListeners.get(type);
- if (v != null) {
- v.remove(listener);
+ synchronized (serviceListeners) {
+ final Collection v = (Collection) serviceListeners.get(type);
+ if (v != null) {
+ v.remove(listener);
+ }
}
}

Back to the top