Author: rickhall
Date: Mon Sep 20 20:58:24 2010
New Revision: 999116

URL: http://svn.apache.org/viewvc?rev=999116&view=rev
Log:
Bundle locks should be reentrant. (FELIX-2598)

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=999116&r1=999115&r2=999116&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 
Mon Sep 20 20:58:24 2010
@@ -4679,9 +4679,11 @@ public class Felix extends BundleImpl im
         {
             // Wait if the desired bundle is already locked by someone else
             // or if any thread has the global lock, unless the current thread
-            // holds the global lock.
+            // holds the global lock or the bundle lock already.
             while (!bundle.isLockable() ||
-                ((m_globalLockThread != null) && (m_globalLockThread != 
Thread.currentThread())))
+                ((bundle.getLockingThread() != Thread.currentThread())
+                    && (m_globalLockThread != null)
+                    && (m_globalLockThread != Thread.currentThread())))
             {
                 // Check to make sure the bundle is in a desired state.
                 // If so, keep waiting. If not, throw an exception.


Reply via email to