GeezerVison is showing docs.oracle.com — ForkJoinWorkerThread (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
compact1, compact2, compact3
java.util.concurrent
Class ForkJoinWorkerThread
-
-
Method Summary
All Methods Instance Methods Concrete Methods
| Modifier and Type |
Method |
Description |
ForkJoinPool |
getPool() |
Returns the pool hosting this thread.
|
int |
getPoolIndex() |
Returns the unique index number of this thread in its pool.
|
protected void |
onStart() |
Initializes internal state after construction but before
processing any tasks.
|
protected void |
onTermination(Throwable exception) |
Performs cleanup associated with termination of this worker
thread.
|
void |
run() |
This method is required to be public, but should never be
called explicitly.
|
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
-
-
Method Detail
-
getPoolIndex
public int getPoolIndex()
Returns the unique index number of this thread in its pool.
The returned value ranges from zero to the maximum number of
threads (minus one) that may exist in the pool, and does not
change during the lifetime of the thread. This method may be
useful for applications that track status or collect results
per-worker-thread rather than per-task.
- Returns:
- the index number
-
onStart
protected void onStart()
Initializes internal state after construction but before
processing any tasks. If you override this method, you must
invoke super.onStart() at the beginning of the method.
Initialization requires care: Most fields must have legal
default values, to ensure that attempted accesses from other
threads work correctly even before this thread starts
processing tasks.
-
onTermination
protected void onTermination(Throwable exception)
Performs cleanup associated with termination of this worker
thread. If you override this method, you must invoke
super.onTermination at the end of the overridden method.
- Parameters:
exception - the exception causing this thread to abort due
to an unrecoverable error, or null if completed normally
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|