mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8236778: Add Atomic::fetch_and_add
Reviewed-by: kbarrett, dholmes
This commit is contained in:
parent
5013cf6e0c
commit
17106c9e9d
32 changed files with 152 additions and 146 deletions
|
@ -2452,7 +2452,7 @@ public:
|
|||
}
|
||||
|
||||
bool try_claim(PSParallelCompact::UpdateDensePrefixTask& reference) {
|
||||
uint claimed = Atomic::add(&_counter, 1u) - 1; // -1 is so that we start with zero
|
||||
uint claimed = Atomic::fetch_and_add(&_counter, 1u);
|
||||
if (claimed < _insert_index) {
|
||||
reference = _backing_array[claimed];
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue