mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
Reviewed-by: lucy, rehn, dholmes
This commit is contained in:
parent
6869c08e6a
commit
71a38a4720
15 changed files with 354 additions and 268 deletions
|
@ -59,7 +59,8 @@ class GlobalCounter::CounterThreadCheck : public ThreadClosure {
|
|||
void GlobalCounter::write_synchronize() {
|
||||
assert((*Thread::current()->get_rcu_counter() & COUNTER_ACTIVE) == 0x0, "must be outside a critcal section");
|
||||
// Atomic::add must provide fence since we have storeload dependency.
|
||||
volatile uintx gbl_cnt = Atomic::add((uintx)COUNTER_INCREMENT, &_global_counter._counter);
|
||||
volatile uintx gbl_cnt = Atomic::add((uintx)COUNTER_INCREMENT, &_global_counter._counter,
|
||||
memory_order_conservative);
|
||||
// Do all RCU threads.
|
||||
CounterThreadCheck ctc(gbl_cnt);
|
||||
for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue