8275730: Relax memory constraint on MultiThreadedRefCounter
Reviewed-by: mgronlun, minqi
This commit is contained in:
parent
615063364a
commit
a316c06e03
@ -112,15 +112,15 @@ class MultiThreadedRefCounter {
|
||||
MultiThreadedRefCounter() : _refs(0) {}
|
||||
|
||||
void inc() const {
|
||||
Atomic::add(&_refs, 1);
|
||||
Atomic::inc(&_refs, memory_order_relaxed);
|
||||
}
|
||||
|
||||
bool dec() const {
|
||||
return 0 == Atomic::add(&_refs, (-1));
|
||||
return 0 == Atomic::sub(&_refs, 1, memory_order_relaxed);
|
||||
}
|
||||
|
||||
intptr_t current() const {
|
||||
return _refs;
|
||||
return Atomic::load(&_refs);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user