[Rpm-maint] [rpm-software-management/rpm] Turn nrefs into atomic_int (PR #3370)

Florian Festi notifications at github.com
Fri Oct 11 13:20:45 UTC 2024


To me https://en.cppreference.com/w/cpp/atomic/atomic/operator_arith reads like the value returned from the ++ and -- operators are indeed obtained atomically:

```
    operator++() performs atomic pre-increment. Equivalent to return fetch_add(1) + 1;.
    operator++(int) performs atomic post-increment. Equivalent to return fetch_add(1);.
    operator--() performs atomic pre-decrement. Equivalent to return fetch_sub(1) - 1;.
    operator--(int) performs atomic post-decrement. Equivalent to return fetch_sub(1);. 
```

But then there is all this talk about fences and memory_order that makes my head spin. So what do I know?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3370#issuecomment-2407402876
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3370/c2407402876 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20241011/226ff6b4/attachment.html>


More information about the Rpm-maint mailing list