FELIX-357 activation and deactivation may run concurrently

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@573189 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/main/java/org/apache/felix/scr/AbstractComponentManager.java b/scr/src/main/java/org/apache/felix/scr/AbstractComponentManager.java
index 15df450..3f7ca54 100644
--- a/scr/src/main/java/org/apache/felix/scr/AbstractComponentManager.java
+++ b/scr/src/main/java/org/apache/felix/scr/AbstractComponentManager.java
@@ -299,7 +299,7 @@
      *   4. Call the activate method, if present
      *   [5. Register provided services]
      */
-    private void activateInternal()
+    private synchronized void activateInternal()
     {
         // CONCURRENCY NOTE: This method is only called from within the
         //     ComponentActorThread to enable, activate or reactivate the
@@ -315,6 +315,7 @@
         {
             getActivator().log( LogService.LOG_DEBUG,
                 "Component cannot be activated because the Activator is being disposed", m_componentMetadata, null );
+            setState( STATE_UNSATISFIED );
             return;
         }
 
@@ -372,13 +373,13 @@
      * 2. Unbind any bound services
      * 3. Release references to the component instance and component context
     **/
-    private void deactivateInternal()
+    private synchronized void deactivateInternal()
     {
         // CONCURRENCY NOTE: This method may be called either from the
         //     ComponentActorThread to handle application induced disabling or
         //     as a result of an unsatisfied service dependency leading to
         //     component deactivation. We therefore have to guard against
-        //     paralell state changes.from application
+        //     paralell state changes.
         if ( !setStateConditional( STATE_ACTIVATING | STATE_ACTIVE | STATE_REGISTERED | STATE_FACTORY,
             STATE_DEACTIVATING ) )
         {