Author: pderop
Date: Fri Feb  5 08:46:34 2016
New Revision: 1728617

URL: http://svn.apache.org/viewvc?rev=1728617&view=rev
Log:
FELIX-5177: it is safer to declare m_configType as volatile (as Jan Willem did 
in its initial patch), because we
can't predict how a component is started: if a component is created first in 
one thread, and started in another one, then 
all component parameters should be stored in volatile variables.
I will have to make another JIRA issue in order to apply the same for all other 
component and dependencies API parameters.

Modified:
    
felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java

Modified: 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java?rev=1728617&r1=1728616&r2=1728617&view=diff
==============================================================================
--- 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java
 (original)
+++ 
felix/trunk/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/ConfigurationDependencyImpl.java
 Fri Feb  5 08:46:34 2016
@@ -49,11 +49,10 @@ import org.osgi.service.cm.ManagedServic
  * @author <a href="mailto:[email protected]";>Felix Project Team</a>
  */
 public class ConfigurationDependencyImpl extends 
AbstractDependency<ConfigurationDependency> implements ConfigurationDependency, 
ManagedService {
-    // Our fields are not volatile because they are "safely published" using 
the DM thread model (based on a Concurrent queue).
     private Dictionary<String, Object> m_settings;
        private String m_pid;
        private ServiceRegistration m_registration;
-       private Class<?> m_configType;
+       private volatile Class<?> m_configType;
     private MetaTypeProviderImpl m_metaType;
        private final AtomicBoolean m_updateInvokedCache = new AtomicBoolean();
        private final Logger m_logger;


Reply via email to