summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Rudyy <orudyy@apache.org>2013-01-27 14:59:06 +0000
committerAlex Rudyy <orudyy@apache.org>2013-01-27 14:59:06 +0000
commite511ff88a299c43dd21a69e2f6b1f9a28a8a0bad (patch)
tree826ea5942cce36ff50f6ca3570fc53b1bb6b1d61
parent2e6141970e4d4b74abbe415707e7b2f15d9b3078 (diff)
downloadqpid-python-e511ff88a299c43dd21a69e2f6b1f9a28a8a0bad.tar.gz
QPID-4390: Fix a dead lock occuring on starting the broker when bdb store is activated in one thread and JMX plugin is started in another. The dead lock occurs when bdb thread tries to add an exchange from store and the main thread tries to create the exchangeMBean at the same time
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/java-broker-config-qpid-4390@1439094 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java
index 9acacac0f3..e1a2921154 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/model/adapter/AbstractAdapter.java
@@ -101,7 +101,7 @@ abstract class AbstractAdapter implements ConfiguredObject
protected void notifyStateChanged(final State currentState, final State desiredState)
{
- synchronized (this)
+ synchronized (_changeListeners)
{
for(ConfigurationChangeListener listener : _changeListeners)
{
@@ -116,7 +116,7 @@ abstract class AbstractAdapter implements ConfiguredObject
{
throw new NullPointerException("Cannot add a null listener");
}
- synchronized (this)
+ synchronized (_changeListeners)
{
if(!_changeListeners.contains(listener))
{
@@ -131,7 +131,7 @@ abstract class AbstractAdapter implements ConfiguredObject
{
throw new NullPointerException("Cannot remove a null listener");
}
- synchronized (this)
+ synchronized (_changeListeners)
{
return _changeListeners.remove(listener);
}
@@ -140,7 +140,7 @@ abstract class AbstractAdapter implements ConfiguredObject
protected void childAdded(ConfiguredObject child)
{
- synchronized (this)
+ synchronized (_changeListeners)
{
for(ConfigurationChangeListener listener : _changeListeners)
{
@@ -152,7 +152,7 @@ abstract class AbstractAdapter implements ConfiguredObject
protected void childRemoved(ConfiguredObject child)
{
- synchronized (this)
+ synchronized (_changeListeners)
{
for(ConfigurationChangeListener listener : _changeListeners)
{
@@ -181,7 +181,7 @@ abstract class AbstractAdapter implements ConfiguredObject
@Override
public final Map<String, Object> getActualAttributes()
{
- synchronized (this)
+ synchronized (_attributes)
{
return new HashMap<String, Object>(_attributes);
}
@@ -189,7 +189,7 @@ abstract class AbstractAdapter implements ConfiguredObject
private Object getActualAttribute(final String name)
{
- synchronized (this)
+ synchronized (_attributes)
{
return _attributes.get(name);
}
@@ -198,7 +198,7 @@ abstract class AbstractAdapter implements ConfiguredObject
public Object setAttribute(final String name, final Object expected, final Object desired)
throws IllegalStateException, AccessControlException, IllegalArgumentException
{
- synchronized (this)
+ synchronized (_attributes)
{
Object currentValue = getAttribute(name);
if((currentValue == null && expected == null)
@@ -216,7 +216,7 @@ abstract class AbstractAdapter implements ConfiguredObject
public <T extends ConfiguredObject> T getParent(final Class<T> clazz)
{
- synchronized (this)
+ synchronized (_parents)
{
return (T) _parents.get(clazz);
}
@@ -224,7 +224,7 @@ abstract class AbstractAdapter implements ConfiguredObject
protected <T extends ConfiguredObject> void addParent(Class<T> clazz, T parent)
{
- synchronized (this)
+ synchronized (_parents)
{
_parents.put(clazz, parent);
}