Skip to content

Commit

Permalink
8267953: restore 'volatile' to ObjectMonitor::_owner field
Browse files Browse the repository at this point in the history
Reviewed-by: aph
  • Loading branch information
Daniel D. Daugherty committed May 29, 2021
1 parent 964bac9 commit 6627432
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/share/runtime/objectMonitor.hpp
Expand Up @@ -147,13 +147,13 @@ class ObjectMonitor : public CHeapObj<mtInternal> {
sizeof(WeakHandle));
// Used by async deflation as a marker in the _owner field:
#define DEFLATER_MARKER reinterpret_cast<void*>(-1)
void* _owner; // pointer to owning thread OR BasicLock
void* volatile _owner; // pointer to owning thread OR BasicLock
volatile jlong _previous_owner_tid; // thread id of the previous owner of the monitor
// Separate _owner and _next_om on different cache lines since
// both 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*) +
DEFINE_PAD_MINUS_SIZE(1, OM_CACHE_LINE_SIZE, sizeof(void* volatile) +
sizeof(volatile jlong));
ObjectMonitor* _next_om; // Next ObjectMonitor* linkage
volatile intx _recursions; // recursion count, 0 for first entry
Expand Down

1 comment on commit 6627432

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.