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 boolean
Whether to set daemon mode.private static final AtomicInteger
The thread index counter, used for assigning unique thread ids.private final String
The 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:
newThread
in interfaceThreadFactory
- Parameters:
runnable
- the runnable- Returns:
- the thread
-