< prev index next >

src/java.base/share/classes/java/util/concurrent/ForkJoinWorkerThread.java

Print this page

        

@@ -77,23 +77,35 @@
 
     final ForkJoinPool pool;                // the pool this thread works in
     final ForkJoinPool.WorkQueue workQueue; // work-stealing mechanics
 
     /**
-     * Creates a ForkJoinWorkerThread operating in the given pool.
+     * Creates a ForkJoinWorkerThread operating in the given thread group and
+     * pool.
      *
+     * @param group thread group, can be null
      * @param pool the pool this thread works in
      * @throws NullPointerException if pool is null
      */
-    protected ForkJoinWorkerThread(ForkJoinPool pool) {
+    protected ForkJoinWorkerThread(ThreadGroup group, ForkJoinPool pool) {
         // Use a placeholder until a useful name can be set in registerWorker
-        super("aForkJoinWorkerThread");
+        super(group, "aForkJoinWorkerThread");
         this.pool = pool;
         this.workQueue = pool.registerWorker(this);
     }
 
     /**
+     * Creates a ForkJoinWorkerThread operating in the given pool.
+     *
+     * @param pool the pool this thread works in
+     * @throws NullPointerException if pool is null
+     */
+    protected ForkJoinWorkerThread(ForkJoinPool pool) {
+        this(null, pool);
+    }
+
+    /**
      * Version for use by the default pool.  Supports setting the
      * context class loader.  This is a separate constructor to avoid
      * affecting the protected constructor.
      */
     ForkJoinWorkerThread(ForkJoinPool pool, ClassLoader ccl) {
< prev index next >