8306687: Relax memory ordering constraints on metaspace atomic counters
Reviewed-by: shade, minqi
This commit is contained in:
parent
33d6614150
commit
5f4965d422
@ -93,22 +93,22 @@ public:
|
||||
|
||||
AbstractAtomicCounter() : _c(0) {}
|
||||
|
||||
T get() const { return _c; }
|
||||
T get() const { return Atomic::load(&_c); }
|
||||
|
||||
void increment() {
|
||||
Atomic::inc(&_c);
|
||||
Atomic::inc(&_c, memory_order_relaxed);
|
||||
}
|
||||
|
||||
void decrement() {
|
||||
Atomic::dec(&_c);
|
||||
Atomic::dec(&_c, memory_order_relaxed);
|
||||
}
|
||||
|
||||
void increment_by(T v) {
|
||||
Atomic::add(&_c, v);
|
||||
Atomic::add(&_c, v, memory_order_relaxed);
|
||||
}
|
||||
|
||||
void decrement_by(T v) {
|
||||
Atomic::sub(&_c, v);
|
||||
Atomic::sub(&_c, v, memory_order_relaxed);
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
|
Loading…
x
Reference in New Issue
Block a user