mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 04:12:08 -04:00
Merge branch '444-isc_refcount_decrement-uses-invalid-memory-ordering' into 'master'
Resolve "isc_refcount_decrement() uses invalid memory ordering" Closes #444 See merge request isc-projects/bind9!560
This commit is contained in:
commit
d0ba302028
1 changed files with 3 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
@ -69,7 +69,7 @@ typedef atomic_uint_fast32_t isc_refcount_t;
|
|||
* \returns previous value of reference counter.
|
||||
*/
|
||||
#define isc_refcount_increment0(target) \
|
||||
atomic_fetch_add_explicit(target, 1, memory_order_relaxed)
|
||||
isc_refcount_increment(target)
|
||||
|
||||
/** \def isc_refcount_increment(ref)
|
||||
* \brief increases reference counter by 1.
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue