Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
public interface VirtualThreadsConfig {

/**
* Virtual thread name prefix. The name of the virtual thread will be the prefix followed by a unique number.
* Virtual thread names. The name of the virtual thread will be the prefix followed by a unique number.
*/
@WithDefault("quarkus-virtual-thread-")
@WithDefault("quarkus-virtual-thread")
Optional<String> namePrefix();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ static ExecutorService newVirtualThreadPerTaskExecutorWithName(String prefix)
Class<?> vtbClass = Class.forName("java.lang.Thread$Builder$OfVirtual");
// .name()
if (prefix != null) {
Method name = vtbClass.getMethod("name", String.class, long.class);
vtb = name.invoke(vtb, prefix, 0);
// why this is not using name(prefix, 0)?
// see https://bugs.openjdk.org/browse/JDK-8372410
Method name = vtbClass.getMethod("name", String.class);
vtb = name.invoke(vtb, prefix);
}
// .uncaughtExceptionHandler()
Method uncaughtHandler = vtbClass.getMethod("uncaughtExceptionHandler", Thread.UncaughtExceptionHandler.class);
Expand Down
Loading