Skip to content

Commit

Permalink
8278031: MultiThreadedRefCounter should not use relaxed atomic decrement
Browse files Browse the repository at this point in the history
Reviewed-by: kbarrett
  • Loading branch information
Markus Grönlund committed Dec 6, 2021
1 parent 8d190dd commit d14f06a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/hotspot/share/jfr/utilities/jfrRefCountPointer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ class MultiThreadedRefCounter {
}

bool dec() const {
return 0 == Atomic::sub(&_refs, 1, memory_order_relaxed);
if (0 == Atomic::sub(&_refs, 1, memory_order_release)) {
OrderAccess::acquire();

This comment has been minimized.

Copy link
@dholmes-ora

dholmes-ora Dec 6, 2021

Member

I don't follow this. What release is this acquire synchronizing with?

return true;
}
return false;
}

intptr_t current() const {
Expand Down

1 comment on commit d14f06a

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