8236778: Add Atomic::fetch_and_add

Reviewed-by: kbarrett, dholmes
This commit is contained in:
Stefan Karlsson 2020-01-24 09:15:08 +01:00
parent 5013cf6e0c
commit 17106c9e9d
32 changed files with 152 additions and 146 deletions

View file

@ -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;