From 6f920d8a2ff5fe8715f115a82b1c57c23234aa22 Mon Sep 17 00:00:00 2001 From: Gengchen Tuo Date: Thu, 17 Aug 2023 12:45:40 -0400 Subject: [PATCH] Set scoped value bindings for newly-created thread Related: https://github.com/eclipse-openj9/openj9/pull/17402 https://github.com/eclipse-openj9/openj9/issues/16677 Co-authored-by: Babneet Singh Signed-off-by: Gengchen Tuo --- src/java.base/share/classes/java/lang/Thread.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/java.base/share/classes/java/lang/Thread.java b/src/java.base/share/classes/java/lang/Thread.java index 455487f89e6..8c99f62b4d2 100644 --- a/src/java.base/share/classes/java/lang/Thread.java +++ b/src/java.base/share/classes/java/lang/Thread.java @@ -25,7 +25,7 @@ /* * =========================================================================== - * (c) Copyright IBM Corp. 2021, 2022 All Rights Reserved + * (c) Copyright IBM Corp. 2021, 2023 All Rights Reserved * =========================================================================== */ @@ -3189,6 +3189,9 @@ private Thread(String vmName, Object vmThreadGroup, int vmPriority, boolean vmIs setNameImpl(eetop, "main"); System.completeInitialization(); } + + // special value to indicate this is a newly-created Thread + this.scopedValueBindings = NEW_THREAD_BINDINGS; } private boolean isDead() {