SafeForkJoinWorkerThreadFactory (Apache Tomcat 9.0.120 API Documentation)
Description: declaration: package: org.apache.catalina.startup, class: SafeForkJoinWorkerThreadFactory

# Class SafeForkJoinWorkerThreadFactory

java.lang.Object
org.apache.catalina.startup.SafeForkJoinWorkerThreadFactory

All Implemented Interfaces:
  `ForkJoinPool.ForkJoinWorkerThreadFactory`

public class SafeForkJoinWorkerThreadFactory extends Object implements ForkJoinPool.ForkJoinWorkerThreadFactory
Provides a `ForkJoinPool.ForkJoinWorkerThreadFactory` that provides `ForkJoinWorkerThread`s that won't trigger memory leaks due to retained references to web application class loaders.

Note: This class must be available on the bootstrap class path for it to be visible to `ForkJoinPool`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SafeForkJoinWorkerThreadFactory()`
  Default constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ForkJoinWorkerThread`
  `newThread(ForkJoinPool pool)`
  Create a new `SafeForkJoinWorkerThreadFactory.SafeForkJoinWorkerThread` for the given pool.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SafeForkJoinWorkerThreadFactory

    public SafeForkJoinWorkerThreadFactory()
    Default constructor.

- ## Method Details

  - ### newThread

    public ForkJoinWorkerThread newThread(ForkJoinPool pool)
    Create a new `SafeForkJoinWorkerThreadFactory.SafeForkJoinWorkerThread` for the given pool.
    Specified by:
      `newThread` in interface `ForkJoinPool.ForkJoinWorkerThreadFactory`
    Parameters:
      `pool` - the fork-join pool
    Returns:
      a new worker thread with a safe context class loader