mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8042195: Introduce umbrella header orderAccess.inline.hpp
Reviewed-by: dholmes, kvn, stefank, twisti
This commit is contained in:
parent
3073f25b0d
commit
6e6f0720a9
81 changed files with 196 additions and 243 deletions
|
@ -436,18 +436,7 @@ class Thread: public ThreadShadow {
|
|||
jlong allocated_bytes() { return _allocated_bytes; }
|
||||
void set_allocated_bytes(jlong value) { _allocated_bytes = value; }
|
||||
void incr_allocated_bytes(jlong size) { _allocated_bytes += size; }
|
||||
jlong cooked_allocated_bytes() {
|
||||
jlong allocated_bytes = OrderAccess::load_acquire(&_allocated_bytes);
|
||||
if (UseTLAB) {
|
||||
size_t used_bytes = tlab().used_bytes();
|
||||
if ((ssize_t)used_bytes > 0) {
|
||||
// More-or-less valid tlab. The load_acquire above should ensure
|
||||
// that the result of the add is <= the instantaneous value
|
||||
return allocated_bytes + used_bytes;
|
||||
}
|
||||
}
|
||||
return allocated_bytes;
|
||||
}
|
||||
inline jlong cooked_allocated_bytes();
|
||||
|
||||
TRACE_DATA* trace_data() { return &_trace_data; }
|
||||
|
||||
|
@ -1046,12 +1035,8 @@ class JavaThread: public Thread {
|
|||
#else
|
||||
// Use membars when accessing volatile _thread_state. See
|
||||
// Threads::create_vm() for size checks.
|
||||
JavaThreadState thread_state() const {
|
||||
return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state);
|
||||
}
|
||||
void set_thread_state(JavaThreadState s) {
|
||||
OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
|
||||
}
|
||||
inline JavaThreadState thread_state() const;
|
||||
inline void set_thread_state(JavaThreadState s);
|
||||
#endif
|
||||
ThreadSafepointState *safepoint_state() const { return _safepoint_state; }
|
||||
void set_safepoint_state(ThreadSafepointState *state) { _safepoint_state = state; }
|
||||
|
@ -1775,7 +1760,7 @@ public:
|
|||
// clearing/querying jni attach status
|
||||
bool is_attaching_via_jni() const { return _jni_attach_state == _attaching_via_jni; }
|
||||
bool has_attached_via_jni() const { return is_attaching_via_jni() || _jni_attach_state == _attached_via_jni; }
|
||||
void set_done_attaching_via_jni() { _jni_attach_state = _attached_via_jni; OrderAccess::fence(); }
|
||||
inline void set_done_attaching_via_jni();
|
||||
private:
|
||||
// This field is used to determine if a thread has claimed
|
||||
// a par_id: it is UINT_MAX if the thread has not claimed a par_id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue