]> git.ipfire.org Git - thirdparty/bind9.git/commit
Use release memory ordering when incrementing reference counter
authorOndřej Surý <ondrej@isc.org>
Mon, 9 Sep 2024 14:03:53 +0000 (16:03 +0200)
committerOndřej Surý <ondrej@isc.org>
Mon, 30 Sep 2024 09:03:01 +0000 (11:03 +0200)
commit88227ea6655ec513d555ad0cdb52d22e7f9928a2
tree9518658a023ee75dd878670374dd617f2688134e
parentd7d1804f16ee79ce5e02edde5323e4aa874a5334
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.
lib/isc/include/isc/refcount.h