< prev index next >

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

Print this page




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


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