You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by pa...@apache.org on 2009/10/30 15:33:00 UTC

svn commit: r831311 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java

Author: pauls
Date: Fri Oct 30 14:33:00 2009
New Revision: 831311

URL: http://svn.apache.org/viewvc?rev=831311&view=rev
Log:
Resolve a possible deadlock during system startup if system bundle stop is called from inside an activator.start method and the system bundle is still in the STARTNG state. The framework will now just throw an exception as a result of the stop call. As a side effect this makes it possible again to call System.exit inside an activator.start method while the framework is still in the STARTING state. However, the framework will not be shutdown when the jvm exits. (FELIX-1816, FELIX-1812)

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java?rev=831311&r1=831310&r2=831311&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Fri Oct 30 14:33:00 2009
@@ -761,6 +761,14 @@
                 AdminPermission.EXECUTE));
         }
 
+        synchronized (m_bundleLock) 
+        {
+            if ((getState() & (STARTING | STOPPING)) != 0)
+            {
+                throw new BundleException("Can't stop the system bundle while it is either starting or stopping.");
+            }
+        }
+
         stopBundle(this, true);
     }