@ThreadSafe public final class ThreadFactoryUtils extends Object
ThreadFactory
class.Modifier and Type | Method and Description |
---|---|
static ThreadFactory |
build(String nameFormat,
boolean isDaemon)
Creates a
ThreadFactory that spawns off threads. |
static ForkJoinPool.ForkJoinWorkerThreadFactory |
buildFjp(String nameFormat,
boolean isDaemon)
Creates a
ForkJoinPool.ForkJoinWorkerThreadFactory that spawns off threads
for ForkJoinPool . |
public static ThreadFactory build(String nameFormat, boolean isDaemon)
ThreadFactory
that spawns off threads.nameFormat
- name pattern for each thread. should contain '%d' to distinguish between
threads.isDaemon
- if true, the ThreadFactory
will create
daemon threads.public static ForkJoinPool.ForkJoinWorkerThreadFactory buildFjp(String nameFormat, boolean isDaemon)
ForkJoinPool.ForkJoinWorkerThreadFactory
that spawns off threads
for ForkJoinPool
.nameFormat
- name pattern for each thread. should contain '%d' to distinguish between
threads.isDaemon
- if true, the ThreadFactory
will create
daemon threads.Copyright © 2023. All Rights Reserved.