8240773: JFR: Non-Java threads are not serialized

Reviewed-by: mgronlun
This commit is contained in:
Stefan Karlsson 2020-03-19 14:15:29 +01:00
parent fa069be2f2
commit e2947fe9e8

View File

@ -46,16 +46,15 @@ static JavaThread* next_java_thread(JavaThreadIteratorWithHandle& iter) {
}
static NonJavaThread* next_non_java_thread(NonJavaThread::Iterator& iter) {
NonJavaThread* next = NULL;
while (!iter.end()) {
next = iter.current();
NonJavaThread* next = iter.current();
iter.step();
assert(next != NULL, "invariant");
if (!thread_inclusion_predicate(next)) {
continue;
if (thread_inclusion_predicate(next)) {
return next;
}
}
return next;
return NULL;
}
JfrJavaThreadIteratorAdapter::JfrJavaThreadIteratorAdapter() : _iter(), _next(next_java_thread(_iter)) {}