aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Ross2013-02-27 14:05:18 (EST)
committerJohn Ross2013-03-13 15:37:32 (EDT)
commit377920e6cf6f952557477488acdb5e7fc38c3c9b (patch)
tree40faca68503965bb4630d877c2cdfc2affcda5b1
parentd817394fd2a1fb8fd80d243f22e9a95f097ace4f (diff)
downloadrt.equinox.bundles-377920e6cf6f952557477488acdb5e7fc38c3c9b.zip
rt.equinox.bundles-377920e6cf6f952557477488acdb5e7fc38c3c9b.tar.gz
rt.equinox.bundles-377920e6cf6f952557477488acdb5e7fc38c3c9b.tar.bz2
Bug 401940 - [coordinator] ConcurrentModificationException when terminating a coordination.
Made participantToCoordination a synchronized map. This protected against concurrent access between addParticipant and terminate.
-rw-r--r--bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/CoordinatorImpl.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/CoordinatorImpl.java b/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/CoordinatorImpl.java
index 94a997a..ed3ebe3 100644
--- a/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/CoordinatorImpl.java
+++ b/bundles/org.eclipse.equinox.coordinator/src/org/eclipse/equinox/coordinator/CoordinatorImpl.java
@@ -13,6 +13,7 @@ package org.eclipse.equinox.coordinator;
import java.security.Permission;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.IdentityHashMap;
@@ -45,7 +46,7 @@ public class CoordinatorImpl implements Coordinator {
// Coordination IDs must be unique across all using bundles.
private static final Map<Long, CoordinationImpl> idToCoordination = new HashMap<Long, CoordinationImpl>();
// Coordination participation must be tracked across all using bundles.
- private static final Map<Participant, CoordinationImpl> participantToCoordination = new IdentityHashMap<Participant, CoordinationImpl>();
+ private static final Map<Participant, CoordinationImpl> participantToCoordination = Collections.synchronizedMap(new IdentityHashMap<Participant, CoordinationImpl>());
private static ThreadLocal<WeakCoordinationStack> coordinationStack = new ThreadLocal<WeakCoordinationStack>() {
@Override