mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8300575: JVMTI support when using alternative virtual thread implementation
Reviewed-by: lmesnik, sspitsyn, alanb
This commit is contained in:
parent
25bfed3b12
commit
83bea26df4
69 changed files with 558 additions and 121 deletions
|
@ -2585,10 +2585,8 @@ public class Thread implements Runnable {
|
|||
StackTraceElement[][] traces = dumpThreads(threads);
|
||||
Map<Thread, StackTraceElement[]> m = HashMap.newHashMap(threads.length);
|
||||
for (int i = 0; i < threads.length; i++) {
|
||||
Thread thread = threads[i];
|
||||
StackTraceElement[] stackTrace = traces[i];
|
||||
// BoundVirtualThread objects may be in list returned by the VM
|
||||
if (!thread.isVirtual() && stackTrace != null) {
|
||||
if (stackTrace != null) {
|
||||
m.put(threads[i], stackTrace);
|
||||
}
|
||||
// else terminated so we don't put it in the map
|
||||
|
@ -2658,11 +2656,7 @@ public class Thread implements Runnable {
|
|||
* Return an array of all live threads.
|
||||
*/
|
||||
static Thread[] getAllThreads() {
|
||||
Thread[] threads = getThreads();
|
||||
return Stream.of(threads)
|
||||
// BoundVirtualThread objects may be in list returned by the VM
|
||||
.filter(Predicate.not(Thread::isVirtual))
|
||||
.toArray(Thread[]::new);
|
||||
return getThreads();
|
||||
}
|
||||
|
||||
private static native StackTraceElement[][] dumpThreads(Thread[] threads);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue