Skip to content
Permalink
Browse files
8278031: MultiThreadedRefCounter should not use relaxed atomic decrement
Reviewed-by: kbarrett
  • Loading branch information
Markus Grönlund committed Dec 6, 2021
1 parent 8d190dd commit d14f06a9630d2cd2a929d0e44ebe4bb10e20dbd4
Showing 1 changed file with 5 additions and 1 deletion.
@@ -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 {

1 comment on commit d14f06a

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on d14f06a Dec 6, 2021

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.