Withdrawn: modify VirtualThreadPinnedEventThrows.java
Alan Bateman
alanb at openjdk.org
Tue Nov 14 14:14:51 UTC 2023
On Fri, 8 Sep 2023 02:20:25 GMT, ywj <duke at openjdk.org> wrote:
> This test is for testing parking when pinned and VirtualThreadPinnedEvent.commit fails with OOME.However, this test can also pass if OOM is not thrown.Therefore, it is not possible to determine whether VirtualThreadPinnedEvent has thrown an exception.
>
> In reference to the parkOnCarrierThread method in VirtualThread in JDK 22, if OOM (Out of Memory Error) is thrown, then the event will be null.
>
> private void parkOnCarrierThread(boolean timed, long nanos) {
> assert state() == RUNNING;
>
> VirtualThreadPinnedEvent event;
> try {
> event = new VirtualThreadPinnedEvent();
> event.begin();
> } catch (OutOfMemoryError e) {
> event = null;
> }
>
> So, I added a condition to confirm that OOM (Out of Memory Error) has been thrown and that the event is null (assertEquals(0, virtualThreadPinnedEventCount);).
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.org/loom/pull/205
More information about the loom-dev
mailing list