From 1eab5bd2aed9c6242cd879c66dda650132556a92 Mon Sep 17 00:00:00 2001 From: Jack Lu Date: Thu, 16 Mar 2023 14:58:44 -0400 Subject: [PATCH] Initialize Continuation.vthread in constructor Signed-off-by: Jack Lu --- src/java.base/share/classes/java/lang/VirtualThread.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/lang/VirtualThread.java b/src/java.base/share/classes/java/lang/VirtualThread.java index efec3b90bf0..3c3db9fe74b 100644 --- a/src/java.base/share/classes/java/lang/VirtualThread.java +++ b/src/java.base/share/classes/java/lang/VirtualThread.java @@ -24,7 +24,7 @@ */ /* * =========================================================================== - * (c) Copyright IBM Corp. 2022, 2022 All Rights Reserved + * (c) Copyright IBM Corp. 2022, 2023 All Rights Reserved * =========================================================================== */ package java.lang; @@ -177,6 +177,7 @@ static ContinuationScope continuationScope() { private static class VThreadContinuation extends Continuation { VThreadContinuation(VirtualThread vthread, Runnable task) { super(VTHREAD_SCOPE, () -> vthread.run(task)); + this.vthread = vthread; } @Override protected void onPinned(Continuation.Pinned reason) {