[FELIX-3393] Possible deadlock with reentrant calls

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1300588 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/Felix.java b/framework/src/main/java/org/apache/felix/framework/Felix.java
index d4272ac..46a1162 100644
--- a/framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -4847,7 +4847,8 @@
             // holds the global lock or the bundle lock already.
             while (!bundle.isLockable() ||
                 ((m_globalLockThread != null)
-                    && (m_globalLockThread != Thread.currentThread())))
+                    && (m_globalLockThread != Thread.currentThread())
+                    && (bundle.getLockingThread() != Thread.currentThread())))
             {
                 // Check to make sure the bundle is in a desired state.
                 // If so, keep waiting. If not, throw an exception.