Skip to content

Commit

Permalink
fixes to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
pchilano committed Sep 30, 2024
1 parent a7bf316 commit 0111b3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ void C2_MacroAssembler::fast_unlock_lightweight(Register obj, Register reg_rax,
}

bind(unlocked);
xorl(t, t); // Fast Unlock ZF = 1
xorl(t1, t1); // Fast Unlock ZF = 1

#ifdef ASSERT
// Check that unlocked label is reached with ZF set.
Expand Down
13 changes: 7 additions & 6 deletions src/hotspot/share/runtime/objectMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,8 @@ void ObjectMonitor::EnterI(JavaThread* current) {

// For virtual threads that are pinned, do a timed-park instead to
// alleviate some deadlocks cases where succesor cannot run.
int recheckInterval = 1;
static int MAX_RECHECK_INTERVAL = 1000;
int recheck_interval = 1;
bool do_timed_parked = false;
ContinuationEntry* ce = current->last_continuation();
if (ce != nullptr && ce->is_virtual_thread()) {
Expand All @@ -902,11 +903,11 @@ void ObjectMonitor::EnterI(JavaThread* current) {

// park self
if (do_timed_parked) {
current->_ParkEvent->park((jlong) recheckInterval);
// Increase the recheckInterval, but clamp the value.
recheckInterval *= 8;
if (recheckInterval > MAX_RECHECK_INTERVAL) {
recheckInterval = MAX_RECHECK_INTERVAL;
current->_ParkEvent->park((jlong) recheck_interval);
// Increase the recheck_interval, but clamp the value.
recheck_interval *= 8;
if (recheck_interval > MAX_RECHECK_INTERVAL) {
recheck_interval = MAX_RECHECK_INTERVAL;
}
} else {
current->_ParkEvent->park();
Expand Down

0 comments on commit 0111b3d

Please sign in to comment.