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

Alan Bateman alanb at openjdk.java.net
Sun Apr 17 16:03:32 UTC 2022


On Fri, 15 Apr 2022 21:15:45 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> Alan Bateman has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Refresh
>
> src/java.base/share/classes/jdk/internal/vm/Continuation.java line 94:
> 
>> 92:             default:
>> 93:                 throw new AssertionError("Unknown pinned reason: " + reason);
>> 94:         }
> 
> Suggestion:
> 
>         return switch (reason) {
>             case 2 -> Pinned.CRITICAL_SECTION;
>             case 3 -> Pinned.NATIVE;
>             case 4 -> Pinned.MONITOR;
>             default -> throw new AssertionError("Unknown pinned reason: " + reason);
>         };

That would be clearer (I think this predates switch expressions).

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

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


More information about the serviceability-dev mailing list