equal
deleted
inserted
replaced
26 #define SHARE_VM_RUNTIME_THREAD_INLINE_HPP |
26 #define SHARE_VM_RUNTIME_THREAD_INLINE_HPP |
27 |
27 |
28 #include "runtime/atomic.hpp" |
28 #include "runtime/atomic.hpp" |
29 #include "runtime/os.inline.hpp" |
29 #include "runtime/os.inline.hpp" |
30 #include "runtime/thread.hpp" |
30 #include "runtime/thread.hpp" |
31 #include "runtime/threadSMR.hpp" |
|
32 |
31 |
33 inline void Thread::set_suspend_flag(SuspendFlags f) { |
32 inline void Thread::set_suspend_flag(SuspendFlags f) { |
34 assert(sizeof(jint) == sizeof(_suspend_flags), "size mismatch"); |
33 assert(sizeof(jint) == sizeof(_suspend_flags), "size mismatch"); |
35 uint32_t flags; |
34 uint32_t flags; |
36 do { |
35 do { |
210 inline void JavaThread::set_terminated_value() { |
209 inline void JavaThread::set_terminated_value() { |
211 // use release-store so the setting of _terminated is seen more quickly |
210 // use release-store so the setting of _terminated is seen more quickly |
212 OrderAccess::release_store((volatile jint *) &_terminated, (jint) _thread_terminated); |
211 OrderAccess::release_store((volatile jint *) &_terminated, (jint) _thread_terminated); |
213 } |
212 } |
214 |
213 |
215 inline void Threads::add_smr_tlh_times(uint add_value) { |
|
216 Atomic::add(add_value, &_smr_tlh_times); |
|
217 } |
|
218 |
|
219 inline void Threads::inc_smr_tlh_cnt() { |
|
220 Atomic::inc(&_smr_tlh_cnt); |
|
221 } |
|
222 |
|
223 inline void Threads::update_smr_tlh_time_max(uint new_value) { |
|
224 while (true) { |
|
225 uint cur_value = _smr_tlh_time_max; |
|
226 if (new_value <= cur_value) { |
|
227 // No need to update max value so we're done. |
|
228 break; |
|
229 } |
|
230 if (Atomic::cmpxchg(new_value, &_smr_tlh_time_max, cur_value) == cur_value) { |
|
231 // Updated max value so we're done. Otherwise try it all again. |
|
232 break; |
|
233 } |
|
234 } |
|
235 } |
|
236 |
|
237 #endif // SHARE_VM_RUNTIME_THREAD_INLINE_HPP |
214 #endif // SHARE_VM_RUNTIME_THREAD_INLINE_HPP |