< prev index next >

src/hotspot/share/runtime/threadSMR.inline.hpp

Print this page




  61 
  62 inline void ThreadsSMRSupport::inc_tlh_cnt() {
  63   Atomic::inc(&_tlh_cnt);
  64 }
  65 
  66 inline void ThreadsSMRSupport::update_tlh_time_max(uint new_value) {
  67   while (true) {
  68     uint cur_value = _tlh_time_max;
  69     if (new_value <= cur_value) {
  70       // No need to update max value so we're done.
  71       break;
  72     }
  73     if (Atomic::cmpxchg(new_value, &_tlh_time_max, cur_value) == cur_value) {
  74       // Updated max value so we're done. Otherwise try it all again.
  75       break;
  76     }
  77   }
  78 }
  79 
  80 inline ThreadsList* ThreadsSMRSupport::get_java_thread_list() {
  81   return (ThreadsList*)OrderAccess::load_acquire(&_java_thread_list);
  82 }
  83 
  84 inline bool ThreadsSMRSupport::is_a_protected_JavaThread_with_lock(JavaThread *thread) {
  85   MutexLocker ml(Threads_lock->owned_by_self() ? NULL : Threads_lock);
  86   return is_a_protected_JavaThread(thread);
  87 }
  88 
  89 inline void ThreadsSMRSupport::update_tlh_stats(uint millis) {
  90   ThreadsSMRSupport::inc_tlh_cnt();
  91   ThreadsSMRSupport::add_tlh_times(millis);
  92   ThreadsSMRSupport::update_tlh_time_max(millis);
  93 }
  94 
  95 #endif // SHARE_RUNTIME_THREADSMR_INLINE_HPP


  61 
  62 inline void ThreadsSMRSupport::inc_tlh_cnt() {
  63   Atomic::inc(&_tlh_cnt);
  64 }
  65 
  66 inline void ThreadsSMRSupport::update_tlh_time_max(uint new_value) {
  67   while (true) {
  68     uint cur_value = _tlh_time_max;
  69     if (new_value <= cur_value) {
  70       // No need to update max value so we're done.
  71       break;
  72     }
  73     if (Atomic::cmpxchg(new_value, &_tlh_time_max, cur_value) == cur_value) {
  74       // Updated max value so we're done. Otherwise try it all again.
  75       break;
  76     }
  77   }
  78 }
  79 
  80 inline ThreadsList* ThreadsSMRSupport::get_java_thread_list() {
  81   return (ThreadsList*)Atomic::load_acquire(&_java_thread_list);
  82 }
  83 
  84 inline bool ThreadsSMRSupport::is_a_protected_JavaThread_with_lock(JavaThread *thread) {
  85   MutexLocker ml(Threads_lock->owned_by_self() ? NULL : Threads_lock);
  86   return is_a_protected_JavaThread(thread);
  87 }
  88 
  89 inline void ThreadsSMRSupport::update_tlh_stats(uint millis) {
  90   ThreadsSMRSupport::inc_tlh_cnt();
  91   ThreadsSMRSupport::add_tlh_times(millis);
  92   ThreadsSMRSupport::update_tlh_time_max(millis);
  93 }
  94 
  95 #endif // SHARE_RUNTIME_THREADSMR_INLINE_HPP
< prev index next >