- All Implemented Interfaces:
- java.util.concurrent.ThreadFactory
public class DaemonThreadFactory
extends java.lang.Object
implements java.util.concurrent.ThreadFactory
This is a clone of Executors.DefaultThreadFactory except that the threads it produces are always daemon threads.
Lingering non-daemon threads are often the cause of JVM shutdown hang. All Executors builders that use
the Executors.DefaultThreadFactory produce non-daemon threads which result in this behavior. All Executors
builders have a second form which accepts a non-default ThreadFactory, the ideal conduit to make use of
this DaemonThreadFactory.