RFR: 8284161: Implementation of Virtual Threads (Preview) [v8]

Mandy Chung mchung at openjdk.java.net
Wed Apr 27 18:21:13 UTC 2022


On Wed, 27 Apr 2022 18:13:15 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/PinnedThreadPrinter.java line 58:
>> 
>>> 56: 
>>> 57:     // maps a class to the hashes of stack traces pinned by that code in that class
>>> 58:     private static final Map<Class<?>, Hashes> classToHashes = new WeakHashMap<>();
>> 
>> Can you use `ClassValue` in this case?
>
> I was wondering that too, but held off commenting since it's not super performance critical given `classToHashes` is synchronized on. However, it does make the code a little clearer.

It's not critical and no problem if this is cleaned up as a follow-up.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8166


More information about the core-libs-dev mailing list