Skip to content
Permalink
Browse files

[JBTHR-73] Allow thread enumeration

  • Loading branch information
dmlloyd committed Apr 24, 2019
1 parent fa2feac commit ea34b74e021c42999ff95fb08e98c1c34471355c
BIN +6 KB .DS_Store
Binary file not shown.
BIN +6 KB src/.DS_Store
Binary file not shown.
@@ -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
// =======================================================

0 comments on commit ea34b74

Please sign in to comment.
You can’t perform that action at this time.