small bugfixes

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@893330 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java
index f90df0c..1446957 100644
--- a/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java
+++ b/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/dependencies/ConfigurationDependencyImpl.java
@@ -140,8 +140,9 @@
 	}
 
 	public void updated(Dictionary settings) throws ConfigurationException {
-	    m_updateInvokedCache.clear();
-	    
+	    synchronized (m_updateInvokedCache) {
+	        m_updateInvokedCache.clear();
+	    }
 	    Dictionary oldSettings = null; 
 	    synchronized (this) {
 	        oldSettings = m_settings;
@@ -190,7 +191,11 @@
 	}
 
     public void invokeUpdate(DependencyService ds, Object service, Dictionary settings) throws ConfigurationException {
-        if (m_updateInvokedCache.add(ds)) {
+        boolean wasAdded;
+        synchronized (m_updateInvokedCache) {
+            wasAdded = m_updateInvokedCache.add(ds);
+        }
+        if (wasAdded) {
             String callback = (m_callback == null) ? "updated" : m_callback;
             Method m;
             try {