Skip to content

Commit

Permalink
all thread locals
Browse files Browse the repository at this point in the history
  • Loading branch information
carl-mastrangelo committed Dec 10, 2023
1 parent b713cdc commit d689a8a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions java19/src/jmh/java/io/perfmark/java19/VirtualExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ public final class VirtualExecutor implements ExecutorService {
private final ExecutorService delegate;

public VirtualExecutor(int maxThread, String prefix) {
boolean threadLocalsAllowed = !Boolean.getBoolean(THREAD_LOCALS_DISABLED_PROP);
this.runnables = new LinkedBlockingQueue<>();
this.delegate =
Executors.newThreadPerTaskExecutor(
Thread.ofVirtual().name(prefix, 1).allowSetThreadLocals(threadLocalsAllowed).factory());
Executors.newThreadPerTaskExecutor(Thread.ofVirtual().name(prefix, 1).factory());
for (int i = 0; i < maxThread; i++) {
delegate.execute(new Worker());
}
Expand Down

0 comments on commit d689a8a

Please sign in to comment.