mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
Rewrite isc_refcount API to fetch_and_<op>, instead of former <op>_and_<fetch>
This commit is contained in:
@@ -450,7 +450,7 @@ void
|
||||
dns_acl_attach(dns_acl_t *source, dns_acl_t **target) {
|
||||
REQUIRE(DNS_ACL_VALID(source));
|
||||
|
||||
isc_refcount_increment(&source->refcount, NULL);
|
||||
isc_refcount_increment(&source->refcount);
|
||||
*target = source;
|
||||
}
|
||||
|
||||
@@ -483,13 +483,13 @@ destroy(dns_acl_t *dacl) {
|
||||
void
|
||||
dns_acl_detach(dns_acl_t **aclp) {
|
||||
dns_acl_t *acl = *aclp;
|
||||
unsigned int refs;
|
||||
|
||||
REQUIRE(DNS_ACL_VALID(acl));
|
||||
|
||||
isc_refcount_decrement(&acl->refcount, &refs);
|
||||
if (refs == 0)
|
||||
if (isc_refcount_decrement(&acl->refcount) == 1) {
|
||||
destroy(acl);
|
||||
}
|
||||
|
||||
*aclp = NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user