[Rpm-maint] [rpm-software-management/rpm] Turn nrefs into atomic_int (PR #3370)
Michal Domonkos
notifications at github.com
Tue Oct 15 07:05:37 UTC 2024
My point is, if two threads are running e.g. `headerFree()` while `nrefs` is `1`, then both threads will fail the condition `--nrefs > 0`, even if the `nrefs` decrement itself is atomic, and thus proceed to the cleanup.
I guess your point is that you can't have two threads accessing a header object while `nrefs` is `1` because that's a programming error. That's of course true, but then, isn't that the point of reference counting in the first place that it prevents such programming errors?
It's likely that I just misunderstand the purpose of `nrefs` altogether here, so take that with a grain of salt...
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3370#issuecomment-2413063266
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/3370/c2413063266 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20241015/6023104b/attachment.html>
More information about the Rpm-maint
mailing list