]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
The isc_refcount_decrement must use memory_order_release and isc_refcount_destroy...
authorOndřej Surý <ondrej@sury.org>
Fri, 27 Jul 2018 12:17:09 +0000 (14:17 +0200)
committerOndřej Surý <ondrej@sury.org>
Wed, 5 Dec 2018 13:11:53 +0000 (14:11 +0100)
lib/isc/include/isc/refcount.h

index 80ee9751aefbe782af1bd7c6389987f30a4e7f9e..09d6af0a983571fe8e654674d3e71308799d5e25 100644 (file)
@@ -53,7 +53,7 @@ typedef atomic_uint_fast32_t isc_refcount_t;
  */
 
 #define isc_refcount_current(target)                           \
-       (uint_fast32_t)atomic_load_explicit(target, memory_order_relaxed)
+       (uint_fast32_t)atomic_load_explicit(target, memory_order_acquire)
 
 /** \def isc_refcount_destroy(ref)
  *  \brief a destructor that makes sure that all references were cleared.
@@ -85,6 +85,6 @@ typedef atomic_uint_fast32_t isc_refcount_t;
  *  \returns previous value of reference counter.
  */
 #define isc_refcount_decrement(target)                         \
-       atomic_fetch_sub_explicit(target, 1, memory_order_relaxed)
+       atomic_fetch_sub_explicit(target, 1, memory_order_release)
 
 ISC_LANG_ENDDECLS