diff --git a/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/ClassnameLockManager.java b/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/ClassnameLockManager.java index 3b0ace86f28..432b8118323 100644 --- a/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/ClassnameLockManager.java +++ b/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/ClassnameLockManager.java @@ -119,6 +119,11 @@ private Lock acquireLock(final String classname, final boolean writeLock) { return resultingEntry; }); + // now activate the lock - this must happen outside of the compute() because + // otherwise we would end up in a deadlock with the classnameLocks + // ConcurrentHashMap lock in releaseLock() + lockWrapper[0].lock(); + // return the acquired lock return lockWrapper[0]; }