Permalink
Browse files
[JBTHR-73] Allow thread enumeration
- Loading branch information
|
|
@@ -66,6 +66,8 @@ |
|
|
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a> |
|
|
*/ |
|
|
public final class EnhancedQueueExecutor extends EnhancedQueueExecutorBase6 implements ManageableThreadPoolExecutorService { |
|
|
private static final Thread[] NO_THREADS = new Thread[0]; |
|
|
|
|
|
static { |
|
|
Version.getVersionString(); |
|
|
} |
|
|
@@ -1357,6 +1359,16 @@ public int getPoolSize() { |
|
|
return currentSizeOf(threadStatus); |
|
|
} |
|
|
|
|
|
/** |
|
|
* Get an array containing an approximate snapshot of the currently running threads in |
|
|
* this executor. |
|
|
* |
|
|
* @return an array of running (unterminated) threads (not {@code null}) |
|
|
*/ |
|
|
public Thread[] getRunningThreads() { |
|
|
return runningThreads.toArray(NO_THREADS); |
|
|
} |
|
|
|
|
|
// ======================================================= |
|
|
// Pooled thread body |
|
|
// ======================================================= |
|
|
|