8306647: Implementation of Structured Concurrency (Preview)

8306572: Implementation of Scoped Values (Preview)

Co-authored-by: Alan Bateman <alanb@openjdk.org>
Co-authored-by: Andrew Haley <aph@openjdk.org>
Reviewed-by: psandoz, dfuchs, mchung
This commit is contained in:
Alan Bateman 2023-06-07 06:41:09 +00:00
parent a08c5cb3f1
commit f1c7afcc3f
36 changed files with 3510 additions and 2969 deletions

View file

@ -37,9 +37,9 @@ import java.util.Map;
import java.util.HashMap;
import java.util.Objects;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.StructureViolationException;
import java.util.concurrent.locks.LockSupport;
import jdk.internal.event.ThreadSleepEvent;
import jdk.internal.misc.StructureViolationExceptions;
import jdk.internal.misc.TerminatingThreadLocal;
import jdk.internal.misc.Unsafe;
import jdk.internal.misc.VM;
@ -321,7 +321,7 @@ public class Thread implements Runnable {
// bindings established for running/calling an operation
Object bindings = snapshot.scopedValueBindings();
if (currentThread().scopedValueBindings != bindings) {
StructureViolationExceptions.throwException("Scoped value bindings have changed");
throw new StructureViolationException("Scoped value bindings have changed");
}
this.scopedValueBindings = bindings;