RFR: 8274651: Possible race in FontDesignMetrics.KeyReference.dispose
Phil Race
prr at openjdk.java.net
Fri Oct 1 16:44:32 UTC 2021
On Wed, 29 Sep 2021 14:01:17 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:
> Possible race condition could happen if another thread put value into 'metricsCache' by the same key.
> We can use `ConcurrentHashMap.remove(key, value)` method to avoid it.
The race condition isn't actually a problem, as we'd just need to repopulate the cache in this unlikely scenario, but the fix looks fine. I guess this method was just overlooked when the code was first written.
-------------
Marked as reviewed by prr (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/5753
More information about the client-libs-dev
mailing list