commit | b3b3fea84111ceeb2c6fe9f7ca55f1a247240b87 | [log] [tgz] |
---|---|---|
author | Marcel Offermans <marrs@apache.org> | Wed Jun 06 15:10:43 2007 +0000 |
committer | Marcel Offermans <marrs@apache.org> | Wed Jun 06 15:10:43 2007 +0000 |
tree | 7370749e99df5d4d3ba5676c7c25ffd28cab629c | |
parent | 56db6d38891dd0fbed892995cdbcb238db49b1cc [diff] |
Fixed a concurrency issue. git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@544863 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ConfigurationDependency.java b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ConfigurationDependency.java index 2fb2c3a..ed0f537 100644 --- a/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ConfigurationDependency.java +++ b/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ConfigurationDependency.java
@@ -58,7 +58,7 @@ m_context = context; } - public boolean isAvailable() { + public synchronized boolean isAvailable() { return m_settings != null; } @@ -100,8 +100,11 @@ } // if these settings did not cause a configuration exception, we determine // if they have caused the dependency state to change - Dictionary oldSettings = m_settings; - m_settings = settings; + Dictionary oldSettings = null; + synchronized (this) { + oldSettings = m_settings; + m_settings = settings; + } if ((oldSettings == null) && (settings != null)) { m_service.dependencyAvailable(this); }