Class SimpleThreadFactory
java.lang.Object
nonapi.io.github.classgraph.concurrency.SimpleThreadFactory
- All Implemented Interfaces:
ThreadFactory
Simple implementation of a thread factory.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanWhether to set daemon mode.private static final AtomicIntegerThe thread index counter, used for assigning unique thread ids.private final StringThe thread name prefix. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
threadNamePrefix
The thread name prefix. -
threadIdx
The thread index counter, used for assigning unique thread ids. -
daemon
private final boolean daemonWhether to set daemon mode.
-
-
Constructor Details
-
SimpleThreadFactory
SimpleThreadFactory(String threadNamePrefix, boolean daemon) Constructor.- Parameters:
threadNamePrefix- prefix for created threads.daemon- create daemon threads?
-
-
Method Details
-
newThread
New thread.- Specified by:
newThreadin interfaceThreadFactory- Parameters:
runnable- the runnable- Returns:
- the thread
-