--- old/src/hotspot/share/runtime/threadSMR.inline.hpp 2017-12-04 09:44:36.000000000 -0500 +++ new/src/hotspot/share/runtime/threadSMR.inline.hpp 2017-12-04 09:44:36.000000000 -0500 @@ -59,4 +59,44 @@ return ret; } +inline void ThreadsSMRSupport::add_smr_tlh_times(uint add_value) { + Atomic::add(add_value, &_smr_tlh_times); +} + +inline ThreadsList* ThreadsSMRSupport::get_smr_java_thread_list() { + return (ThreadsList*)OrderAccess::load_acquire(&_smr_java_thread_list); +} + +inline void ThreadsSMRSupport::inc_smr_java_thread_list_alloc_cnt() { + _smr_java_thread_list_alloc_cnt++; +} + +inline void ThreadsSMRSupport::inc_smr_tlh_cnt() { + Atomic::inc(&_smr_tlh_cnt); +} + +inline void ThreadsSMRSupport::update_smr_java_thread_list_max(uint new_value) { + if (new_value > _smr_java_thread_list_max) { + _smr_java_thread_list_max = new_value; + } +} + +inline void ThreadsSMRSupport::update_smr_tlh_time_max(uint new_value) { + while (true) { + uint cur_value = _smr_tlh_time_max; + if (new_value <= cur_value) { + // No need to update max value so we're done. + break; + } + if (Atomic::cmpxchg(new_value, &_smr_tlh_time_max, cur_value) == cur_value) { + // Updated max value so we're done. Otherwise try it all again. + break; + } + } +} + +inline ThreadsList* ThreadsSMRSupport::xchg_smr_java_thread_list(ThreadsList* new_list) { + return (ThreadsList*)Atomic::xchg(new_list, &_smr_java_thread_list); +} + #endif // SHARE_VM_RUNTIME_THREADSMR_INLINE_HPP