Skip to content

Commit

Permalink
Fix concurrency issue in Equinox Caching
Browse files Browse the repository at this point in the history
#233

Fix bug in original PR

Signed-off-by: Stefan Winkler <[email protected]>
  • Loading branch information
xpomul authored and tjwatson committed Apr 25, 2023
1 parent df1bdf7 commit d1fbae8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down

0 comments on commit d1fbae8

Please sign in to comment.