Top Description Fields Constructors Methods
nonapi.io.github.classgraph.concurrency

public Class SimpleThreadFactory

extends Object
implements ThreadFactory
Class Inheritance
All Implemented Interfaces
java.util.concurrent.ThreadFactory
Imports
java.lang.reflect.Method, java.util.concurrent.atomic.AtomicInteger

Simple implementation of a thread factory.
Author
Johno Crawford ([email protected])

Field Summary

Modifier and TypeField and Description
private final boolean
daemon

Whether to set daemon mode.

private static final AtomicInteger
threadIdx

The thread index counter, used for assigning unique thread ids.

private final String
threadNamePrefix

The thread name prefix.

Constructor Summary

AccessConstructor and Description
pack-priv
SimpleThreadFactory(final String
prefix for created threads.
threadNamePrefix
,
final boolean
create daemon threads?
daemon
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public Thread

Returns:

the thread
newThread
(final Runnable
the runnable
runnable
)

Implements java.util.concurrent.ThreadFactory.newThread.

New thread.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

daemonback to summary
private final boolean daemon

Whether to set daemon mode.

threadIdxback to summary
private static final AtomicInteger threadIdx

The thread index counter, used for assigning unique thread ids.

threadNamePrefixback to summary
private final String threadNamePrefix

The thread name prefix.

Constructor Detail

SimpleThreadFactoryback to summary
pack-priv SimpleThreadFactory(final String threadNamePrefix, final boolean daemon)

Constructor.

Parameters
threadNamePrefix:String

prefix for created threads.

daemon:boolean

create daemon threads?

Method Detail

newThreadback to summary
public Thread newThread(final Runnable runnable)

Implements java.util.concurrent.ThreadFactory.newThread.

New thread.

Parameters
runnable:Runnable

the runnable

Returns:Thread

the thread

Annotations
@Override