2
0
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:
Ondřej Surý
2018-08-17 15:16:59 +02:00
parent 7fbbf09d21
commit bef8ac5bae
24 changed files with 254 additions and 468 deletions

View File

@@ -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;
}