Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis@composent.com2010-10-17 19:46:46 +0000
committerslewis@composent.com2010-10-17 19:46:46 +0000
commitc7c989cd9074d9a3a8d636e015279e4756e1409f (patch)
treec5148d9ed8c983d9bf4435365c77133ce9c743e6 /providers
parent0b941f0af799e88f15b941ae217fea5c3f145720 (diff)
downloadorg.eclipse.ecf-c7c989cd9074d9a3a8d636e015279e4756e1409f.tar.gz
org.eclipse.ecf-c7c989cd9074d9a3a8d636e015279e4756e1409f.tar.xz
org.eclipse.ecf-c7c989cd9074d9a3a8d636e015279e4756e1409f.zip
Partial fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=327919
Diffstat (limited to 'providers')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java38
1 files changed, 29 insertions, 9 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
index 6f13ba37f..3e814bff9 100644
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
@@ -173,12 +173,22 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
public void dispose(ID containerID) {
super.dispose(containerID);
unregisterAllServiceRegistrations();
- remoteRegistrys.clear();
- serviceListeners.clear();
- localServiceRegistrations.clear();
- addRegistrationRequests.clear();
- requests.clear();
- pendingUpdateContainers.clear();
+ synchronized (remoteRegistrys) {
+ remoteRegistrys.clear();
+ localServiceRegistrations.clear();
+ }
+ synchronized (serviceListeners) {
+ serviceListeners.clear();
+ }
+ synchronized (addRegistrationRequests) {
+ addRegistrationRequests.clear();
+ }
+ synchronized (requests) {
+ requests.clear();
+ }
+ synchronized (pendingUpdateContainers) {
+ pendingUpdateContainers.clear();
+ }
synchronized (rsQueueLock) {
if (rsListenerDispatchEventManager != null) {
rsListenerDispatchEventManager.close();
@@ -1061,11 +1071,17 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
return;
if (requestId == null)
return;
- AddRegistrationRequest request = (AddRegistrationRequest) addRegistrationRequests.get(requestId);
+ AddRegistrationRequest request = removeAddRegistrationRequest(requestId);
if (request != null)
request.notifyResponse(exception);
}
+ private AddRegistrationRequest removeAddRegistrationRequest(Integer requestId) {
+ synchronized (addRegistrationRequests) {
+ return (AddRegistrationRequest) addRegistrationRequests.remove(requestId);
+ }
+ }
+
/**
* @since 3.2
*/
@@ -1515,7 +1531,9 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
* @since 3.2
*/
protected boolean addRequest(Request request) {
- return requests.add(request);
+ synchronized (requests) {
+ return requests.add(request);
+ }
}
/**
@@ -1538,7 +1556,9 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
* @since 3.2
*/
protected boolean removeRequest(Request request) {
- return requests.remove(request);
+ synchronized (requests) {
+ return requests.remove(request);
+ }
}
protected void logException(int code, String message, Throwable e) {

Back to the top