8278031: MultiThreadedRefCounter should not use relaxed atomic decrement

Reviewed-by: kbarrett
This commit is contained in:
Markus Grönlund 2021-12-06 09:29:28 +00:00
parent 8d190dd003
commit d14f06a963

@ -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();
return true;
}
return false;
}
intptr_t current() const {