< prev index next >

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

Print this page
rev 47862 : imported patch 10.07.open.rebase_20171110.dcubed
rev 47865 : dholmes CR: Fix indents, trailing spaces and various typos. Add descriptions for the '_cnt', '_max' and '_times" fields, add impl notes to document the type choices.


 212 }
 213 
 214 template <class T>
 215 inline void Threads::threads_do_smr(T *tc, Thread *self) {
 216   ThreadsListHandle handle(self);
 217   handle.threads_do(tc);
 218 }
 219 
 220 inline ThreadsList* Threads::get_smr_java_thread_list() {
 221   return (ThreadsList*)OrderAccess::load_acquire(&_smr_java_thread_list);
 222 }
 223 
 224 inline ThreadsList* Threads::xchg_smr_java_thread_list(ThreadsList* new_list) {
 225   return (ThreadsList*)Atomic::xchg(new_list, &_smr_java_thread_list);
 226 }
 227 
 228 inline void Threads::inc_smr_deleted_thread_cnt() {
 229   Atomic::inc(&_smr_deleted_thread_cnt);
 230 }
 231 
 232 inline void Threads::update_smr_deleted_thread_time_max(jint new_value) {
 233   while (true) {
 234     jint cur_value = _smr_deleted_thread_time_max;
 235     if (new_value <= cur_value) {
 236       // No need to update max value so we're done.
 237       break;
 238     }
 239     if (Atomic::cmpxchg(new_value, &_smr_deleted_thread_time_max, cur_value) == cur_value) {
 240       // Updated max value so we're done. Otherwise try it all again.
 241       break;
 242     }
 243   }
 244 }
 245 
 246 inline void Threads::add_smr_deleted_thread_times(jint add_value) {
 247   Atomic::add(add_value, &_smr_deleted_thread_times);
 248 }
 249 
 250 inline void Threads::inc_smr_tlh_cnt() {
 251   Atomic::inc(&_smr_tlh_cnt);
 252 }
 253 
 254 inline void Threads::update_smr_tlh_time_max(jint new_value) {
 255   while (true) {
 256     jint cur_value = _smr_tlh_time_max;
 257     if (new_value <= cur_value) {
 258       // No need to update max value so we're done.
 259       break;
 260     }
 261     if (Atomic::cmpxchg(new_value, &_smr_tlh_time_max, cur_value) == cur_value) {
 262       // Updated max value so we're done. Otherwise try it all again.
 263       break;
 264     }
 265   }
 266 }
 267 
 268 inline void Threads::add_smr_tlh_times(jint add_value) {
 269   Atomic::add(add_value, &_smr_tlh_times);
 270 }
 271 
 272 #endif // SHARE_VM_RUNTIME_THREAD_INLINE_HPP


 212 }
 213 
 214 template <class T>
 215 inline void Threads::threads_do_smr(T *tc, Thread *self) {
 216   ThreadsListHandle handle(self);
 217   handle.threads_do(tc);
 218 }
 219 
 220 inline ThreadsList* Threads::get_smr_java_thread_list() {
 221   return (ThreadsList*)OrderAccess::load_acquire(&_smr_java_thread_list);
 222 }
 223 
 224 inline ThreadsList* Threads::xchg_smr_java_thread_list(ThreadsList* new_list) {
 225   return (ThreadsList*)Atomic::xchg(new_list, &_smr_java_thread_list);
 226 }
 227 
 228 inline void Threads::inc_smr_deleted_thread_cnt() {
 229   Atomic::inc(&_smr_deleted_thread_cnt);
 230 }
 231 
 232 inline void Threads::update_smr_deleted_thread_time_max(uint new_value) {
 233   while (true) {
 234     uint cur_value = _smr_deleted_thread_time_max;
 235     if (new_value <= cur_value) {
 236       // No need to update max value so we're done.
 237       break;
 238     }
 239     if (Atomic::cmpxchg(new_value, &_smr_deleted_thread_time_max, cur_value) == cur_value) {
 240       // Updated max value so we're done. Otherwise try it all again.
 241       break;
 242     }
 243   }
 244 }
 245 
 246 inline void Threads::add_smr_deleted_thread_times(uint add_value) {
 247   Atomic::add(add_value, &_smr_deleted_thread_times);
 248 }
 249 
 250 inline void Threads::inc_smr_tlh_cnt() {
 251   Atomic::inc(&_smr_tlh_cnt);
 252 }
 253 
 254 inline void Threads::update_smr_tlh_time_max(uint new_value) {
 255   while (true) {
 256     uint cur_value = _smr_tlh_time_max;
 257     if (new_value <= cur_value) {
 258       // No need to update max value so we're done.
 259       break;
 260     }
 261     if (Atomic::cmpxchg(new_value, &_smr_tlh_time_max, cur_value) == cur_value) {
 262       // Updated max value so we're done. Otherwise try it all again.
 263       break;
 264     }
 265   }
 266 }
 267 
 268 inline void Threads::add_smr_tlh_times(uint add_value) {
 269   Atomic::add(add_value, &_smr_tlh_times);
 270 }
 271 
 272 #endif // SHARE_VM_RUNTIME_THREAD_INLINE_HPP
< prev index next >