- All Known Implementing Classes:
ExecutorThreadPool,MonitoredQueuedThreadPool,QueuedThreadPool
- Enclosing class:
- VirtualThreads
public static interface VirtualThreads.Configurable
Implementations of this interface can be configured to use virtual threads.
Whether virtual threads are actually used depends on whether the runtime
supports virtual threads and, if the runtime supports them, whether they are
configured to be used via setUseVirtualThreads(boolean).
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleandefault voidsetUseVirtualThreads(boolean useVirtualThreads)
-
Method Details
-
isUseVirtualThreads
default boolean isUseVirtualThreads()- Returns:
- whether to use virtual threads
-
setUseVirtualThreads
default void setUseVirtualThreads(boolean useVirtualThreads) - Parameters:
useVirtualThreads- whether to use virtual threads- Throws:
UnsupportedOperationException- if the runtime does not support virtual threads- See Also:
-