< prev index next >
src/hotspot/share/runtime/objectMonitor.hpp
Print this page
rev 57232 : v2.00 -> v2.08 (CR8/v2.08/11-for-jdk14) patches combined into one; merge with jdk-14+25 snapshot; merge with jdk-14+26 snapshot.
rev 57233 : See CR8-to-CR9-changes; merge with 8230876.patch (2019.11.15); merge with jdk-14+25 snapshot; fuzzy merge with jdk-14+26 snapshot.
*** 158,174 ****
// can have busy multi-threaded access. _previous_owner_tid is only
// changed by ObjectMonitor::exit() so it is a good choice to share the
// cache line with _owner.
DEFINE_PAD_MINUS_SIZE(1, OM_CACHE_LINE_SIZE, sizeof(void* volatile) +
sizeof(volatile jlong));
! volatile jint _ref_count; // ref count for ObjectMonitor* and used by the async deflation
// protocol. See ObjectSynchronizer::deflate_monitor_using_JT().
// Separate _ref_count and _next_om on different cache lines since
// both can have busy multi-threaded access.
DEFINE_PAD_MINUS_SIZE(2, OM_CACHE_LINE_SIZE, sizeof(volatile jint));
public: // for static synchronizer.cpp access:
! ObjectMonitor* volatile _next_om; // Next ObjectMonitor* linkage
private:
volatile intx _recursions; // recursion count, 0 for first entry
ObjectWaiter* volatile _EntryList; // Threads blocked on entry or reentry.
// The list is actually composed of WaitNodes,
// acting as proxies for Threads.
--- 158,174 ----
// can have busy multi-threaded access. _previous_owner_tid is only
// changed by ObjectMonitor::exit() so it is a good choice to share the
// cache line with _owner.
DEFINE_PAD_MINUS_SIZE(1, OM_CACHE_LINE_SIZE, sizeof(void* volatile) +
sizeof(volatile jlong));
! jint _ref_count; // ref count for ObjectMonitor* and used by the async deflation
// protocol. See ObjectSynchronizer::deflate_monitor_using_JT().
// Separate _ref_count and _next_om on different cache lines since
// both can have busy multi-threaded access.
DEFINE_PAD_MINUS_SIZE(2, OM_CACHE_LINE_SIZE, sizeof(volatile jint));
public: // for static synchronizer.cpp access:
! ObjectMonitor* _next_om; // Next ObjectMonitor* linkage
private:
volatile intx _recursions; // recursion count, 0 for first entry
ObjectWaiter* volatile _EntryList; // Threads blocked on entry or reentry.
// The list is actually composed of WaitNodes,
// acting as proxies for Threads.
*** 270,281 ****
intptr_t is_entered(Thread* current) const;
void* owner() const; // Returns NULL if DEFLATER_MARKER is observed.
// Returns true if owner field == DEFLATER_MARKER and false otherwise.
bool owner_is_DEFLATER_MARKER();
! // Set _owner field to new_value; current value must match old_value.
! void set_owner_from(void* new_value, void* old_value);
// Simply set _owner field to new_value; current value must match old_value.
void simply_set_owner_from(void* new_value, void* old_value);
// Simply set _owner field to new_value; current value must match old_value1 or old_value2.
void simply_set_owner_from(void* new_value, void* old_value1, void* old_value2);
// Simply set _owner field to self; current value must match basic_lock_p.
--- 270,281 ----
intptr_t is_entered(Thread* current) const;
void* owner() const; // Returns NULL if DEFLATER_MARKER is observed.
// Returns true if owner field == DEFLATER_MARKER and false otherwise.
bool owner_is_DEFLATER_MARKER();
! // Clear _owner field; current value must match old_value.
! void release_clear_owner_with_barrier(void* old_value, bool needs_fence);
// Simply set _owner field to new_value; current value must match old_value.
void simply_set_owner_from(void* new_value, void* old_value);
// Simply set _owner field to new_value; current value must match old_value1 or old_value2.
void simply_set_owner_from(void* new_value, void* old_value1, void* old_value2);
// Simply set _owner field to self; current value must match basic_lock_p.
*** 309,319 ****
void Recycle() {
// TODO: add stronger asserts ...
// _cxq == 0 _succ == NULL _owner == NULL _waiters == 0
// _contentions == 0 EntryList == NULL
// _recursions == 0 _WaitSet == NULL
! DEBUG_ONLY(stringStream ss;)
assert((is_busy() | _recursions) == 0, "freeing in-use monitor: %s, "
"recursions=" INTX_FORMAT, is_busy_to_string(&ss), _recursions);
_succ = NULL;
_EntryList = NULL;
_cxq = NULL;
--- 309,321 ----
void Recycle() {
// TODO: add stronger asserts ...
// _cxq == 0 _succ == NULL _owner == NULL _waiters == 0
// _contentions == 0 EntryList == NULL
// _recursions == 0 _WaitSet == NULL
! #ifdef ASSERT
! stringStream ss;
! #endif
assert((is_busy() | _recursions) == 0, "freeing in-use monitor: %s, "
"recursions=" INTX_FORMAT, is_busy_to_string(&ss), _recursions);
_succ = NULL;
_EntryList = NULL;
_cxq = NULL;
*** 346,358 ****
void wait(jlong millis, bool interruptable, TRAPS);
void notify(TRAPS);
void notifyAll(TRAPS);
void print() const;
! //#ifdef ASSERT
void print_debug_style_on(outputStream* st) const;
! //#endif
void print_on(outputStream* st) const;
// Use the following at your own risk
intx complete_exit(TRAPS);
void reenter(intx recursions, TRAPS);
--- 348,360 ----
void wait(jlong millis, bool interruptable, TRAPS);
void notify(TRAPS);
void notifyAll(TRAPS);
void print() const;
! #ifdef ASSERT
void print_debug_style_on(outputStream* st) const;
! #endif
void print_on(outputStream* st) const;
// Use the following at your own risk
intx complete_exit(TRAPS);
void reenter(intx recursions, TRAPS);
< prev index next >