8284161: Implementation of Virtual Threads (Preview)

Co-authored-by: Ron Pressler <rpressler@openjdk.org>
Co-authored-by: Alan Bateman <alanb@openjdk.org>
Co-authored-by: Erik Österlund <eosterlund@openjdk.org>
Co-authored-by: Andrew Haley <aph@openjdk.org>
Co-authored-by: Rickard Bäckman <rbackman@openjdk.org>
Co-authored-by: Markus Grönlund <mgronlun@openjdk.org>
Co-authored-by: Leonid Mesnik <lmesnik@openjdk.org>
Co-authored-by: Serguei Spitsyn <sspitsyn@openjdk.org>
Co-authored-by: Chris Plummer <cjplummer@openjdk.org>
Co-authored-by: Coleen Phillimore <coleenp@openjdk.org>
Co-authored-by: Robbin Ehn <rehn@openjdk.org>
Co-authored-by: Stefan Karlsson <stefank@openjdk.org>
Co-authored-by: Thomas Schatzl <tschatzl@openjdk.org>
Co-authored-by: Sergey Kuksenko <skuksenko@openjdk.org>
Reviewed-by: lancea, eosterlund, rehn, sspitsyn, stefank, tschatzl, dfuchs, lmesnik, dcubed, kevinw, amenkov, dlong, mchung, psandoz, bpb, coleenp, smarks, egahlin, mseledtsov, coffeys, darcy
This commit is contained in:
Alan Bateman 2022-05-07 08:06:16 +00:00
parent 5212535a27
commit 9583e3657e
1133 changed files with 95935 additions and 8335 deletions

View file

@ -24,7 +24,6 @@
*/
package java.lang;
import java.lang.ref.*;
/**
* This class extends {@code ThreadLocal} to provide inheritance of values
@ -49,6 +48,7 @@ import java.lang.ref.*;
* @author Josh Bloch and Doug Lea
* @see ThreadLocal
* @since 1.2
* @see Thread.Builder#inheritInheritableThreadLocals(boolean)
*/
public class InheritableThreadLocal<T> extends ThreadLocal<T> {
@ -78,8 +78,9 @@ public class InheritableThreadLocal<T> extends ThreadLocal<T> {
*
* @param t the current thread
*/
@Override
ThreadLocalMap getMap(Thread t) {
return t.inheritableThreadLocals;
return t.inheritableThreadLocals;
}
/**
@ -88,6 +89,7 @@ public class InheritableThreadLocal<T> extends ThreadLocal<T> {
* @param t the current thread
* @param firstValue value for the initial entry of the table.
*/
@Override
void createMap(Thread t, T firstValue) {
t.inheritableThreadLocals = new ThreadLocalMap(this, firstValue);
}