]> git.ipfire.org Git - thirdparty/bind9.git/commit
[9.20] chg: dev: Use release memory ordering when incrementing reference counter
authorOndřej Surý <ondrej@isc.org>
Wed, 2 Oct 2024 07:09:54 +0000 (07:09 +0000)
committerOndřej Surý <ondrej@isc.org>
Wed, 2 Oct 2024 07:09:54 +0000 (07:09 +0000)
commit19e3cd0cd2c2f334a140603ab41f112bc043aa50
treeeea2c57c6944c7d7a79e4813c1b3ef88ec73a1d2
parentaa078bdd37669f2162f1533ef8e1036773da2531
parent5701bf9dabf640177f4ae7f534a353ab89642fc7
[9.20] chg: dev: Use release memory ordering when incrementing reference counter

As the relaxed memory ordering doesn't ensure any memory
synchronization, it is possible that the increment will succeed even
in the case when it should not - there is a race between
atomic_fetch_sub(..., acq_rel) and atomic_fetch_add(..., relaxed).
Only the result is consistent, but the previous value for both calls
could be same when both calls are executed at the same time.

Backport of MR !9460

Merge branch 'backport-ondrej/use-release-memory-ordering-for-reference-counting-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9567