Skip to content

Commit

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

Reviewed-by: alanb
  • Loading branch information
Viktor Klang committed Feb 27, 2024
1 parent da14aa4 commit 60cbf29
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 60cbf29

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