Skip to content

Commit f8ff296

Browse files
author
Andrew Haley
committed
8360884: Better scoped values
1 parent 5cd40e3 commit f8ff296

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

test/micro/org/openjdk/bench/java/lang/ScopedValuesData.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ public class ScopedValuesData {
5757
public static void run(Runnable action) {
5858
try {
5959
tl1.set(42); tl2.set(2); tl3.set(3); tl4.set(4); tl5.set(5); tl6.set(6);
60-
sl1.get(); // Create the ScopedValue cache as a side effect
6160
tl_atomicInt.set(new AtomicInteger());
6261
VALUES.where(sl_atomicInt, new AtomicInteger())
6362
.where(sl_atomicRef, new AtomicReference<>())
64-
.run(action);
63+
.run(() -> {
64+
sl1.get(); // Create the ScopedValue cache as a side effect
65+
action.run();
66+
});
6567
} finally {
6668
tl1.remove(); tl2.remove(); tl3.remove(); tl4.remove(); tl5.remove(); tl6.remove();
6769
tl_atomicInt.remove();

0 commit comments

Comments
 (0)