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);
 		}