Skip to content
Browse files
8267953: restore 'volatile' to ObjectMonitor::_owner field
Reviewed-by: aph
  • Loading branch information
Daniel D. Daugherty committed May 29, 2021
1 parent 964bac9 commit 66274320251f492b0bba79cdfef88ad5b0d104fa
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/hotspot/share/runtime/objectMonitor.hpp
@@ -147,13 +147,13 @@ class ObjectMonitor : public CHeapObj<mtInternal> {
// 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* volatile) +
sizeof(volatile jlong));
ObjectMonitor* _next_om; // Next ObjectMonitor* linkage
volatile intx _recursions; // recursion count, 0 for first entry

1 comment on commit 6627432

Copy link

@openjdk-notifier openjdk-notifier bot commented on 6627432 May 29, 2021

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.