First attempt to fix FELIX-3839
Reduce the synchronization level in the instance starting process.

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1429853 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java b/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java
index 9e0abad..47cdcd4 100644
--- a/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java
+++ b/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/ComponentFactory.java
@@ -249,7 +249,7 @@
 
     /**
      * Starts the factory.
-     * This method is called when holding the monitor lock.
+     * This method is not called when holding the monitor lock.
      */
     public void starting() {
         if (m_tracker != null) {
diff --git a/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java b/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java
index 5cf04a9..ade4045 100644
--- a/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java
+++ b/ipojo/runtime/core/src/main/java/org/apache/felix/ipojo/IPojoFactory.java
@@ -580,7 +580,7 @@
     /**

      * Starting method.

      * This method is called when the factory is starting.

-     * This method is called when holding the lock on the factory.

+     * This method is <strong>not</strong> called when holding the lock on the factory.

      */

     public abstract void starting();

 

@@ -590,16 +590,20 @@
      * calls the {@link IPojoFactory#starting()} method,

      * and published services if the factory is public.

      */

-    public synchronized void start() {

-        if (m_described) { // Already started.

-            return;

+    public void start() {

+        synchronized (this) {

+            if (m_described) { // Already started.

+                return;

+            }

         }

 

         m_componentDesc = getComponentTypeDescription();

 

         starting();

 

-        computeFactoryState();

+        synchronized (this) {

+            computeFactoryState();

+        }

 

         if (m_isPublic) {

             // Exposition of the factory service