Skip to content
Permalink
Browse files
8271513: support JavaThreadIteratorWithHandle replacement by new Thre…
…adsList::Iterator

Co-authored-by: Kim Barrett <kbarrett@openjdk.org>
Reviewed-by: kbarrett, dholmes, coleenp
  • Loading branch information
Daniel D. Daugherty and Kim Barrett committed Aug 6, 2021
1 parent cc61520 commit fa36e33437e9c8346a75ace8ed1b8c245b919d25
Showing with 9 additions and 2 deletions.
  1. +2 −2 src/hotspot/share/runtime/thread.cpp
  2. +4 −0 src/hotspot/share/runtime/threadSMR.hpp
  3. +3 −0 src/hotspot/share/runtime/threadSMR.inline.hpp
@@ -854,7 +854,7 @@ void JavaThread::collect_counters(jlong* array, int length) {
for (int i = 0; i < length; i++) {
array[i] = _jvmci_old_thread_counters[i];
}
for (JavaThreadIteratorWithHandle jtiwh; JavaThread *tp = jtiwh.next(); ) {
for (JavaThread* tp : ThreadsListHandle()) {
if (jvmci_counters_include(tp)) {
for (int i = 0; i < length; i++) {
array[i] += tp->_jvmci_counters[i];
@@ -915,7 +915,7 @@ class VM_JVMCIResizeCounters : public VM_Operation {
}

// Now resize each threads array
for (JavaThreadIteratorWithHandle jtiwh; JavaThread *tp = jtiwh.next(); ) {
for (JavaThread* tp : ThreadsListHandle()) {
if (!tp->resize_counters(JVMCICounterSize, _new_size)) {
_failed = true;
break;
@@ -328,6 +328,10 @@ class ThreadsListHandle : public StackObj {
return _list_ptr.list();
}

using Iterator = ThreadsList::Iterator;
inline Iterator begin();
inline Iterator end();

template <class T>
void threads_do(T *cl) const {
return list()->threads_do(cl);
@@ -107,6 +107,9 @@ inline void ThreadsList::threads_do(T *cl) const {
}
}

ThreadsListHandle::Iterator ThreadsListHandle::begin() { return list()->begin(); }
ThreadsListHandle::Iterator ThreadsListHandle::end() { return list()->end(); }

// These three inlines are private to ThreadsSMRSupport, but
// they are called by public inline update_tlh_stats() below:

1 comment on commit fa36e33

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on fa36e33 Aug 6, 2021

Please sign in to comment.