mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +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
|
@ -54,7 +54,7 @@ class ConcurrentHashTable<CONFIG, F>::BucketsOperation {
|
|||
|
||||
// Returns true if you succeeded to claim the range start -> (stop-1).
|
||||
bool claim(size_t* start, size_t* stop) {
|
||||
size_t claimed = Atomic::add(&_next_to_claim, (size_t)1) - 1;
|
||||
size_t claimed = Atomic::fetch_and_add(&_next_to_claim, 1u);
|
||||
if (claimed >= _stop_task) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue