Skip to content

Commit 6627432

Browse files
author
Daniel D. Daugherty
committed
8267953: restore 'volatile' to ObjectMonitor::_owner field
Reviewed-by: aph
1 parent 964bac9 commit 6627432

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hotspot/share/runtime/objectMonitor.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ class ObjectMonitor : public CHeapObj<mtInternal> {
147147
sizeof(WeakHandle));
148148
// Used by async deflation as a marker in the _owner field:
149149
#define DEFLATER_MARKER reinterpret_cast<void*>(-1)
150-
void* _owner; // pointer to owning thread OR BasicLock
150+
void* volatile _owner; // pointer to owning thread OR BasicLock
151151
volatile jlong _previous_owner_tid; // thread id of the previous owner of the monitor
152152
// Separate _owner and _next_om on different cache lines since
153153
// both can have busy multi-threaded access. _previous_owner_tid is only
154154
// changed by ObjectMonitor::exit() so it is a good choice to share the
155155
// cache line with _owner.
156-
DEFINE_PAD_MINUS_SIZE(1, OM_CACHE_LINE_SIZE, sizeof(void*) +
156+
DEFINE_PAD_MINUS_SIZE(1, OM_CACHE_LINE_SIZE, sizeof(void* volatile) +
157157
sizeof(volatile jlong));
158158
ObjectMonitor* _next_om; // Next ObjectMonitor* linkage
159159
volatile intx _recursions; // recursion count, 0 for first entry

0 commit comments

Comments
 (0)