Skip to content

Commit

Permalink
8325754: Dead AbstractQueuedSynchronizer$ConditionNodes survive minor…
Browse files Browse the repository at this point in the history
… garbage collections

Backport-of: 60cbf2925024b1c2253256688ae41741fff0a860
  • Loading branch information
neethu-prasad authored and RealCLanger committed Jun 24, 2024
1 parent 57824ed commit 241b054
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1127,13 +1127,18 @@ public ConditionObject() { }
private void doSignal(ConditionNode first, boolean all) {
while (first != null) {
ConditionNode next = first.nextWaiter;

if ((firstWaiter = next) == null)
lastWaiter = null;
else
first.nextWaiter = null; // GC assistance

if ((first.getAndUnsetStatus(COND) & COND) != 0) {
enqueue(first);
if (!all)
break;
}

first = next;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1506,13 +1506,18 @@ public ConditionObject() { }
private void doSignal(ConditionNode first, boolean all) {
while (first != null) {
ConditionNode next = first.nextWaiter;

if ((firstWaiter = next) == null)
lastWaiter = null;
else
first.nextWaiter = null; // GC assistance

if ((first.getAndUnsetStatus(COND) & COND) != 0) {
enqueue(first);
if (!all)
break;
}

first = next;
}
}
Expand Down

1 comment on commit 241b054

@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.