Skip to content

Commit 42968db

Browse files
committedJun 24, 2021
8269293: ObjectMonitor thread id fields should be 64 bits.
Reviewed-by: mgronlun, dcubed
1 parent 2fd7943 commit 42968db

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
 

‎src/hotspot/share/runtime/objectMonitor.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ bool ObjectMonitor::check_owner(TRAPS) {
14311431

14321432
static void post_monitor_wait_event(EventJavaMonitorWait* event,
14331433
ObjectMonitor* monitor,
1434-
jlong notifier_tid,
1434+
uint64_t notifier_tid,
14351435
jlong timeout,
14361436
bool timedout) {
14371437
assert(event != NULL, "invariant");
@@ -2243,7 +2243,7 @@ void ObjectMonitor::print_debug_style_on(outputStream* st) const {
22432243
st->print_cr(" [%d] = '\\0'", (int)sizeof(_pad_buf0) - 1);
22442244
st->print_cr(" }");
22452245
st->print_cr(" _owner = " INTPTR_FORMAT, p2i(owner_raw()));
2246-
st->print_cr(" _previous_owner_tid = " INTPTR_FORMAT, _previous_owner_tid);
2246+
st->print_cr(" _previous_owner_tid = " UINT64_FORMAT, _previous_owner_tid);
22472247
st->print_cr(" _pad_buf1 = {");
22482248
st->print_cr(" [0] = '\\0'");
22492249
st->print_cr(" ...");

‎src/hotspot/share/runtime/objectMonitor.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ObjectWaiter : public StackObj {
4747
ObjectWaiter* volatile _next;
4848
ObjectWaiter* volatile _prev;
4949
JavaThread* _thread;
50-
jlong _notifier_tid;
50+
uint64_t _notifier_tid;
5151
ParkEvent * _event;
5252
volatile int _notified;
5353
volatile TStates TState;
@@ -148,13 +148,13 @@ class ObjectMonitor : public CHeapObj<mtInternal> {
148148
// Used by async deflation as a marker in the _owner field:
149149
#define DEFLATER_MARKER reinterpret_cast<void*>(-1)
150150
void* volatile _owner; // pointer to owning thread OR BasicLock
151-
volatile uintptr_t _previous_owner_tid; // thread id of the previous owner of the monitor
151+
volatile uint64_t _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.
156156
DEFINE_PAD_MINUS_SIZE(1, OM_CACHE_LINE_SIZE, sizeof(void* volatile) +
157-
sizeof(volatile uintptr_t));
157+
sizeof(volatile uint64_t));
158158
ObjectMonitor* _next_om; // Next ObjectMonitor* linkage
159159
volatile intx _recursions; // recursion count, 0 for first entry
160160
ObjectWaiter* volatile _EntryList; // Threads blocked on entry or reentry.

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Jun 24, 2021

@openjdk-notifier[bot]
Please sign in to comment.