}
UNLOCK_LOOKUP;
- DESTROYLOCK(&lookup_lock);
+ isc_mutex_destroy(&lookup_lock);
debug("Removing log context");
isc_log_destroy(&lctx);
check_result(result, "dns_master_dumptostream3");
}
- DESTROYLOCK(&namelock);
+ isc_mutex_destroy(&namelock);
if (printstats)
- DESTROYLOCK(&statslock);
+ isc_mutex_destroy(&statslock);
if (!output_stdout) {
result = isc_stdio_close(outfp);
/* We don't have to acquire the lock here since it's already unlinked */
dns_acl_detach(&listener->acl);
- DESTROYLOCK(&listener->lock);
+ isc_mutex_destroy(&listener->lock);
isc_mem_putanddetach(&listener->mctx, listener, sizeof(*listener));
}
if (result != ISC_R_SUCCESS) {
if (listener->acl != NULL)
dns_acl_detach(&listener->acl);
- DESTROYLOCK(&listener->lock);
+ isc_mutex_destroy(&listener->lock);
isc_mem_putanddetach(&listener->mctx, listener,
sizeof(*listener));
}
failed:
dlopen_log(ISC_LOG_ERROR, "dlz_dlopen of '%s' failed", dlzname);
- if (cd->dl_path != NULL)
+ if (cd->dl_path != NULL) {
isc_mem_free(mctx, cd->dl_path);
- if (cd->dlzname != NULL)
+ }
+ if (cd->dlzname != NULL) {
isc_mem_free(mctx, cd->dlzname);
- if (dlopen_flags != 0)
- (void) isc_mutex_destroy(&cd->lock);
+ }
+ if (dlopen_flags != 0) {
+ isc_mutex_destroy(&cd->lock);
+ }
#ifdef HAVE_DLCLOSE
- if (cd->dl_handle)
+ if (cd->dl_handle) {
dlclose(cd->dl_handle);
+ }
#endif
isc_mem_put(mctx, cd, sizeof(*cd));
isc_mem_destroy(&mctx);
MAYBE_UNLOCK(cd);
}
- if (cd->dl_path)
+ if (cd->dl_path) {
isc_mem_free(cd->mctx, cd->dl_path);
- if (cd->dlzname)
+ }
+ if (cd->dlzname) {
isc_mem_free(cd->mctx, cd->dlzname);
+ }
#ifdef HAVE_DLCLOSE
- if (cd->dl_handle)
+ if (cd->dl_handle) {
dlclose(cd->dl_handle);
+ }
#endif
- (void) isc_mutex_destroy(&cd->lock);
+ isc_mutex_destroy(&cd->lock);
mctx = cd->mctx;
isc_mem_put(mctx, cd, sizeof(*cd));
return (ISC_R_SUCCESS);
cleanup_lock:
- DESTROYLOCK(&cd->lock);
+ isc_mutex_destroy(&cd->lock);
failed:
dlopen_log(ISC_LOG_ERROR, "dlz_dlopen of '%s' failed", dlzname);
- if (cd->dl_path)
+ if (cd->dl_path) {
isc_mem_free(mctx, cd->dl_path);
- if (cd->dlzname)
+ }
+ if (cd->dlzname) {
isc_mem_free(mctx, cd->dlzname);
- if (triedload)
- (void) isc_mutex_destroy(&cd->lock);
- if (cd->dl_handle)
+ }
+ if (triedload) {
+ isc_mutex_destroy(&cd->lock);
+ }
+ if (cd->dl_handle) {
FreeLibrary(cd->dl_handle);
+ }
isc_mem_put(mctx, cd, sizeof(*cd));
isc_mem_destroy(&mctx);
return (result);
if (cd->dl_handle)
FreeLibrary(cd->dl_handle);
- DESTROYLOCK(&cd->lock);
+ isc_mutex_destroy(&cd->lock);
mctx = cd->mctx;
isc_mem_put(mctx, cd, sizeof(*cd));
isc_mem_destroy(&mctx);
- DESTROYLOCK(&lock);
+ isc_mutex_destroy(&lock);
return (0);
}
isc_mem_stats(mctx, stdout);
isc_mem_destroy(&mctx);
- DESTROYLOCK(&lock);
+ isc_mutex_destroy(&lock);
isc_app_finish();
/*
* Initialise the new resources.
*/
- result = isc_mutexblock_init(newentrylocks, n);
- if (result != ISC_R_SUCCESS)
- goto cleanup;
+ isc_mutexblock_init(newentrylocks, n);
for (i = 0; i < n; i++) {
ISC_LIST_INIT(newentries[i]);
/*
* Cleanup old resources.
*/
- DESTROYMUTEXBLOCK(adb->entrylocks, adb->nentries);
+ isc_mutexblock_destroy(adb->entrylocks, adb->nentries);
isc_mem_put(adb->mctx, adb->entries,
sizeof(*adb->entries) * adb->nentries);
isc_mem_put(adb->mctx, adb->deadentries,
/*
* Initialise the new resources.
*/
- result = isc_mutexblock_init(newnamelocks, n);
- if (result != ISC_R_SUCCESS)
- goto cleanup;
+ isc_mutexblock_init(newnamelocks, n);
for (i = 0; i < n; i++) {
ISC_LIST_INIT(newnames[i]);
/*
* Cleanup old resources.
*/
- DESTROYMUTEXBLOCK(adb->namelocks, adb->nnames);
+ isc_mutexblock_destroy(adb->namelocks, adb->nnames);
isc_mem_put(adb->mctx, adb->names,
sizeof(*adb->names) * adb->nnames);
isc_mem_put(adb->mctx, adb->deadnames,
find->magic = 0;
- DESTROYLOCK(&find->lock);
+ isc_mutex_destroy(&find->lock);
isc_mempool_put(adb->ahmp, find);
return (dec_adb_irefcnt(adb));
}
isc_mempool_destroy(&adb->aimp);
isc_mempool_destroy(&adb->afmp);
- DESTROYMUTEXBLOCK(adb->entrylocks, adb->nentries);
+ isc_mutexblock_destroy(adb->entrylocks, adb->nentries);
isc_mem_put(adb->mctx, adb->entries,
sizeof(*adb->entries) * adb->nentries);
isc_mem_put(adb->mctx, adb->deadentries,
isc_mem_put(adb->mctx, adb->entry_refcnt,
sizeof(*adb->entry_refcnt) * adb->nentries);
- DESTROYMUTEXBLOCK(adb->namelocks, adb->nnames);
+ isc_mutexblock_destroy(adb->namelocks, adb->nnames);
isc_mem_put(adb->mctx, adb->names,
sizeof(*adb->names) * adb->nnames);
isc_mem_put(adb->mctx, adb->deadnames,
isc_mem_put(adb->mctx, adb->name_refcnt,
sizeof(*adb->name_refcnt) * adb->nnames);
- DESTROYLOCK(&adb->reflock);
- DESTROYLOCK(&adb->lock);
- DESTROYLOCK(&adb->mplock);
- DESTROYLOCK(&adb->overmemlock);
- DESTROYLOCK(&adb->entriescntlock);
- DESTROYLOCK(&adb->namescntlock);
+ isc_mutex_destroy(&adb->reflock);
+ isc_mutex_destroy(&adb->lock);
+ isc_mutex_destroy(&adb->mplock);
+ isc_mutex_destroy(&adb->overmemlock);
+ isc_mutex_destroy(&adb->entriescntlock);
+ isc_mutex_destroy(&adb->namescntlock);
isc_mem_putanddetach(&adb->mctx, adb, sizeof(dns_adb_t));
}
* Initialize the bucket locks for names and elements.
* May as well initialize the list heads, too.
*/
- result = isc_mutexblock_init(adb->namelocks, adb->nnames);
- if (result != ISC_R_SUCCESS)
- goto fail1;
+ isc_mutexblock_init(adb->namelocks, adb->nnames);
+
for (i = 0; i < adb->nnames; i++) {
ISC_LIST_INIT(adb->names[i]);
ISC_LIST_INIT(adb->deadnames[i]);
adb->entry_refcnt[i] = 0;
adb->irefcnt++;
}
- result = isc_mutexblock_init(adb->entrylocks, adb->nentries);
- if (result != ISC_R_SUCCESS)
- goto fail2;
+ isc_mutexblock_init(adb->entrylocks, adb->nentries);
/*
* Memory pools
#define MPINIT(t, p, n) do { \
result = isc_mempool_create(mem, sizeof(t), &(p)); \
if (result != ISC_R_SUCCESS) \
- goto fail3; \
+ goto fail2; \
isc_mempool_setfreemax((p), FREE_ITEMS); \
isc_mempool_setfillcount((p), FILL_COUNT); \
isc_mempool_setname((p), n); \
isc_mempool_associatelock((p), &adb->mplock); \
-} while (0)
+ } while (0)
MPINIT(dns_adbname_t, adb->nmp, "adbname");
MPINIT(dns_adbnamehook_t, adb->nhmp, "adbnamehook");
*/
result = isc_task_create(adb->taskmgr, 0, &adb->task);
if (result != ISC_R_SUCCESS)
- goto fail3;
+ goto fail2;
isc_task_setname(adb->task, "ADB", adb);
result = isc_stats_create(adb->mctx, &view->adbstats, dns_adbstats_max);
if (result != ISC_R_SUCCESS)
- goto fail3;
+ goto fail2;
set_adbstat(adb, adb->nentries, dns_adbstats_nentries);
set_adbstat(adb, adb->nnames, dns_adbstats_nnames);
*newadb = adb;
return (ISC_R_SUCCESS);
- fail3:
+ fail2:
if (adb->task != NULL)
isc_task_detach(&adb->task);
/* clean up entrylocks */
- DESTROYMUTEXBLOCK(adb->entrylocks, adb->nentries);
-
- fail2: /* clean up namelocks */
- DESTROYMUTEXBLOCK(adb->namelocks, adb->nnames);
+ isc_mutexblock_destroy(adb->entrylocks, adb->nentries);
+ isc_mutexblock_destroy(adb->namelocks, adb->nnames);
fail1: /* clean up only allocated memory */
if (adb->entries != NULL)
if (adb->afmp != NULL)
isc_mempool_destroy(&adb->afmp);
- DESTROYLOCK(&adb->namescntlock);
- DESTROYLOCK(&adb->entriescntlock);
- DESTROYLOCK(&adb->overmemlock);
- DESTROYLOCK(&adb->reflock);
- DESTROYLOCK(&adb->mplock);
- DESTROYLOCK(&adb->lock);
+ isc_mutex_destroy(&adb->namescntlock);
+ isc_mutex_destroy(&adb->entriescntlock);
+ isc_mutex_destroy(&adb->overmemlock);
+ isc_mutex_destroy(&adb->reflock);
+ isc_mutex_destroy(&adb->mplock);
+ isc_mutex_destroy(&adb->lock);
if (adb->excl != NULL)
isc_task_detach(&adb->excl);
isc_mem_putanddetach(&adb->mctx, adb, sizeof(dns_adb_t));
return (ISC_R_SUCCESS);
destroy_lock:
- DESTROYLOCK(&bc->lock);
+ isc_mutex_destroy(&bc->lock);
isc_mem_putanddetach(&bc->mctx, bc, sizeof(dns_badcache_t));
return (result);
}
dns_badcache_flush(bc);
bc->magic = 0;
- DESTROYLOCK(&bc->lock);
+ isc_mutex_destroy(&bc->lock);
isc_mem_put(bc->mctx, bc->table, sizeof(dns_bcentry_t *) * bc->size);
isc_mem_putanddetach(&bc->mctx, bc, sizeof(dns_badcache_t));
*bcp = NULL;
return (ISC_R_SUCCESS);
cleanup_lock:
- DESTROYLOCK(&byaddr->lock);
+ isc_mutex_destroy(&byaddr->lock);
ievent = (isc_event_t *)byaddr->event;
isc_event_free(&ievent);
REQUIRE(byaddr->task == NULL);
dns_lookup_destroy(&byaddr->lookup);
- DESTROYLOCK(&byaddr->lock);
+ isc_mutex_destroy(&byaddr->lock);
byaddr->magic = 0;
isc_mem_putanddetach(&byaddr->mctx, byaddr, sizeof(*byaddr));
cleanup_dbtype:
isc_mem_free(cmctx, cache->db_type);
cleanup_filelock:
- DESTROYLOCK(&cache->filelock);
+ isc_mutex_destroy(&cache->filelock);
cleanup_stats:
isc_stats_detach(&cache->stats);
- DESTROYLOCK(&cache->lock);
+ isc_mutex_destroy(&cache->lock);
cleanup_mem:
if (cache->name != NULL) {
isc_mem_free(cmctx, cache->name);
if (cache->cleaner.iterator != NULL)
dns_dbiterator_destroy(&cache->cleaner.iterator);
- DESTROYLOCK(&cache->cleaner.lock);
+ isc_mutex_destroy(&cache->cleaner.lock);
if (cache->filename) {
isc_mem_free(cache->mctx, cache->filename);
if (cache->stats != NULL)
isc_stats_detach(&cache->stats);
- DESTROYLOCK(&cache->lock);
- DESTROYLOCK(&cache->filelock);
+ isc_mutex_destroy(&cache->lock);
+ isc_mutex_destroy(&cache->filelock);
cache->magic = 0;
isc_mem_detach(&cache->hmctx);
isc_task_detach(&cleaner->task);
if (cleaner->iterator != NULL)
dns_dbiterator_destroy(&cleaner->iterator);
- DESTROYLOCK(&cleaner->lock);
+ isc_mutex_destroy(&cleaner->lock);
return (result);
}
if (isc_refcount_decrement(&catzs->refs) == 1) {
isc_task_destroy(&catzs->updater);
- DESTROYLOCK(&catzs->lock);
+ isc_mutex_destroy(&catzs->lock);
if (catzs->zones != NULL) {
isc_ht_iter_t *iter = NULL;
isc_result_t result;
isc_appctx_destroy(&client->actx);
}
- DESTROYLOCK(&client->lock);
+ isc_mutex_destroy(&client->lock);
client->magic = 0;
isc_mem_putanddetach(&client->mctx, client, sizeof(*client));
* unexpected event). Just clean the arg up.
*/
UNLOCK(&resarg->lock);
- DESTROYLOCK(&resarg->lock);
+ isc_mutex_destroy(&resarg->lock);
isc_mem_put(resarg->client->mctx, resarg, sizeof(*resarg));
}
}
client->task, resolve_done, resarg,
&resarg->trans);
if (result != ISC_R_SUCCESS) {
- DESTROYLOCK(&resarg->lock);
+ isc_mutex_destroy(&resarg->lock);
isc_mem_put(client->mctx, resarg, sizeof(*resarg));
return (result);
}
} else {
UNLOCK(&resarg->lock);
- DESTROYLOCK(&resarg->lock);
+ isc_mutex_destroy(&resarg->lock);
isc_mem_put(client->mctx, resarg, sizeof(*resarg));
}
if (sigrdataset != NULL)
putrdataset(client->mctx, &sigrdataset);
if (rctx != NULL) {
- DESTROYLOCK(&rctx->lock);
+ isc_mutex_destroy(&rctx->lock);
isc_mem_put(mctx, rctx, sizeof(*rctx));
}
if (event != NULL)
INSIST(ISC_LIST_EMPTY(rctx->namelist));
- DESTROYLOCK(&rctx->lock);
+ isc_mutex_destroy(&rctx->lock);
rctx->magic = 0;
isc_mem_put(mctx, rctx, sizeof(*rctx));
* unexpected event). Just clean the arg up.
*/
UNLOCK(&reqarg->lock);
- DESTROYLOCK(&reqarg->lock);
+ isc_mutex_destroy(&reqarg->lock);
isc_mem_put(reqarg->client->mctx, reqarg, sizeof(*reqarg));
}
}
client->task, localrequest_done,
reqarg, &reqarg->trans);
if (result != ISC_R_SUCCESS) {
- DESTROYLOCK(&reqarg->lock);
+ isc_mutex_destroy(&reqarg->lock);
isc_mem_put(client->mctx, reqarg, sizeof(*reqarg));
return (result);
}
} else {
UNLOCK(&reqarg->lock);
- DESTROYLOCK(&reqarg->lock);
+ isc_mutex_destroy(&reqarg->lock);
isc_mem_put(client->mctx, reqarg, sizeof(*reqarg));
}
LOCK(&client->lock);
ISC_LIST_UNLINK(client->reqctxs, ctx, link);
UNLOCK(&client->lock);
- DESTROYLOCK(&ctx->lock);
+ isc_mutex_destroy(&ctx->lock);
isc_mem_put(client->mctx, ctx, sizeof(*ctx));
}
if (event != NULL)
UNLOCK(&client->lock);
- DESTROYLOCK(&ctx->lock);
+ isc_mutex_destroy(&ctx->lock);
ctx->magic = 0;
isc_mem_put(mctx, ctx, sizeof(*ctx));
* unexpected event). Just clean the arg up.
*/
UNLOCK(&uarg->lock);
- DESTROYLOCK(&uarg->lock);
+ isc_mutex_destroy(&uarg->lock);
isc_mem_put(uarg->client->mctx, uarg, sizeof(*uarg));
}
}
internal_update_callback, uarg,
&uarg->trans);
if (result != ISC_R_SUCCESS) {
- DESTROYLOCK(&uarg->lock);
+ isc_mutex_destroy(&uarg->lock);
isc_mem_put(client->mctx, uarg, sizeof(*uarg));
return (result);
}
} else {
UNLOCK(&uarg->lock);
- DESTROYLOCK(&uarg->lock);
+ isc_mutex_destroy(&uarg->lock);
isc_mem_put(client->mctx, uarg, sizeof(*uarg));
}
if (uctx->tsigkey != NULL)
dns_tsigkey_detach(&uctx->tsigkey);
isc_task_detach(&tclone);
- DESTROYLOCK(&uctx->lock);
+ isc_mutex_destroy(&uctx->lock);
uctx->magic = 0;
isc_mem_put(client->mctx, uctx, sizeof(*uctx));
dns_view_detach(&view);
UNLOCK(&client->lock);
- DESTROYLOCK(&uctx->lock);
+ isc_mutex_destroy(&uctx->lock);
uctx->magic = 0;
isc_mem_put(mctx, uctx, sizeof(*uctx));
return (ISC_R_SUCCESS);
clean3:
- DESTROYLOCK(&dbtable->lock);
+ isc_mutex_destroy(&dbtable->lock);
dns_rbt_destroy(&dbtable->rbt);
if (disp->sepool != NULL) {
isc_mempool_destroy(&disp->sepool);
- (void)isc_mutex_destroy(&disp->sepool_lock);
+ isc_mutex_destroy(&disp->sepool_lock);
}
if (disp->socket != NULL)
mgr->magic = 0;
mgr->mctx = NULL;
- DESTROYLOCK(&mgr->lock);
+ isc_mutex_destroy(&mgr->lock);
mgr->state = 0;
isc_mempool_destroy(&mgr->depool);
if (mgr->spool != NULL)
isc_mempool_destroy(&mgr->spool);
- DESTROYLOCK(&mgr->spool_lock);
- DESTROYLOCK(&mgr->bpool_lock);
- DESTROYLOCK(&mgr->dpool_lock);
- DESTROYLOCK(&mgr->rpool_lock);
- DESTROYLOCK(&mgr->depool_lock);
+ isc_mutex_destroy(&mgr->spool_lock);
+ isc_mutex_destroy(&mgr->bpool_lock);
+ isc_mutex_destroy(&mgr->dpool_lock);
+ isc_mutex_destroy(&mgr->rpool_lock);
+ isc_mutex_destroy(&mgr->depool_lock);
if (mgr->qid != NULL)
qid_destroy(mctx, &mgr->qid);
- DESTROYLOCK(&mgr->buffer_lock);
+ isc_mutex_destroy(&mgr->buffer_lock);
if (mgr->blackhole != NULL)
dns_acl_detach(&mgr->blackhole);
if (isc_mempool_create(mgr->mctx, sizeof(dns_dispatchevent_t),
&mgr->depool) != ISC_R_SUCCESS) {
result = ISC_R_NOMEMORY;
- goto kill_spool_lock;
+ goto kill_locks;
}
mgr->rpool = NULL;
isc_mempool_destroy(&mgr->rpool);
kill_depool:
isc_mempool_destroy(&mgr->depool);
- kill_spool_lock:
- DESTROYLOCK(&mgr->spool_lock);
- DESTROYLOCK(&mgr->bpool_lock);
- DESTROYLOCK(&mgr->dpool_lock);
- DESTROYLOCK(&mgr->rpool_lock);
- DESTROYLOCK(&mgr->depool_lock);
- DESTROYLOCK(&mgr->buffer_lock);
- DESTROYLOCK(&mgr->lock);
+ kill_locks:
+ isc_mutex_destroy(&mgr->spool_lock);
+ isc_mutex_destroy(&mgr->bpool_lock);
+ isc_mutex_destroy(&mgr->dpool_lock);
+ isc_mutex_destroy(&mgr->rpool_lock);
+ isc_mutex_destroy(&mgr->depool_lock);
+ isc_mutex_destroy(&mgr->buffer_lock);
+ isc_mutex_destroy(&mgr->lock);
isc_mem_put(mctx, mgr, sizeof(dns_dispatchmgr_t));
isc_mem_detach(&mctx);
isc_mem_put(mctx, qid->sock_table,
qid->qid_nbuckets * sizeof(dispsocketlist_t));
}
- DESTROYLOCK(&qid->lock);
+ isc_mutex_destroy(&qid->lock);
isc_mem_put(mctx, qid, sizeof(*qid));
}
* error returns
*/
kill_lock:
- DESTROYLOCK(&disp->lock);
+ isc_mutex_destroy(&disp->lock);
isc_mempool_put(mgr->dpool, disp);
return (result);
isc_mempool_destroy(&disp->portpool);
disp->mgr = NULL;
- DESTROYLOCK(&disp->lock);
+ isc_mutex_destroy(&disp->lock);
disp->magic = 0;
isc_mempool_put(mgr->dpool, disp);
}
isc_mem_detach(&dset->mctx);
fail_lock:
- DESTROYLOCK(&dset->lock);
+ isc_mutex_destroy(&dset->lock);
isc_mem_put(mctx, dset, sizeof(dns_dispatchset_t));
return (result);
}
dns_dispatch_detach(&(dset->dispatches[i]));
isc_mem_put(dset->mctx, dset->dispatches,
sizeof(dns_dispatch_t *) * dset->ndisp);
- DESTROYLOCK(&dset->lock);
+ isc_mutex_destroy(&dset->lock);
isc_mem_putanddetach(&dset->mctx, dset, sizeof(dns_dispatchset_t));
*dsetp = NULL;
dnsrps_mutex_destroy(void *mutex0) {
isc_mutex_t *mutex = mutex0;
- DESTROYLOCK(mutex);
+ isc_mutex_destroy(mutex);
}
static void
if (dns_name_dynamic(&ecdb->common.origin))
dns_name_free(&ecdb->common.origin, mctx);
- DESTROYLOCK(&ecdb->lock);
+ isc_mutex_destroy(&ecdb->lock);
ecdb->common.impmagic = 0;
ecdb->common.magic = 0;
isc_mem_put(mctx, header, headersize);
}
- DESTROYLOCK(&node->lock);
+ isc_mutex_destroy(&node->lock);
node->magic = 0;
isc_mem_put(mctx, node, sizeof(*node));
dns_name_init(&node->name, NULL);
result = dns_name_dup(name, mctx, &node->name);
if (result != ISC_R_SUCCESS) {
- DESTROYLOCK(&node->lock);
+ isc_mutex_destroy(&node->lock);
isc_mem_put(mctx, node, sizeof(*node));
return (result);
}
return (ISC_R_SUCCESS);
cleanup_lock:
- DESTROYLOCK(&lookup->lock);
+ isc_mutex_destroy(&lookup->lock);
ievent = (isc_event_t *)lookup->event;
isc_event_free(&ievent);
lookup->event = NULL;
if (dns_rdataset_isassociated(&lookup->sigrdataset))
dns_rdataset_disassociate(&lookup->sigrdataset);
- DESTROYLOCK(&lookup->lock);
+ isc_mutex_destroy(&lookup->lock);
lookup->magic = 0;
isc_mem_putanddetach(&lookup->mctx, lookup, sizeof(*lookup));
if (lctx->task != NULL)
isc_task_detach(&lctx->task);
- DESTROYLOCK(&lctx->lock);
+ isc_mutex_destroy(&lctx->lock);
mctx = NULL;
isc_mem_attach(lctx->mctx, &mctx);
isc_mem_detach(&lctx->mctx);
dumpctx_destroy(dns_dumpctx_t *dctx) {
dctx->magic = 0;
- DESTROYLOCK(&dctx->lock);
+ isc_mutex_destroy(&dctx->lock);
dns_dbiterator_destroy(&dctx->dbiter);
if (dctx->version != NULL)
dns_db_closeversion(dctx->db, &dctx->version, false);
locks = isc_mem_allocate(dst__mctx, sizeof(isc_mutex_t) * nlocks);
if (locks == NULL)
return (ISC_R_NOMEMORY);
- result = isc_mutexblock_init(locks, nlocks);
- if (result != ISC_R_SUCCESS)
- goto cleanup_mutexalloc;
+ isc_mutexblock_init(locks, nlocks);
CRYPTO_set_locking_callback(lock_callback);
# if defined(LIBRESSL_VERSION_NUMBER)
CRYPTO_set_id_callback(id_callback);
#endif
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
CRYPTO_set_locking_callback(NULL);
- DESTROYMUTEXBLOCK(locks, nlocks);
- cleanup_mutexalloc:
+ isc_mutexblock_destroy(locks, nlocks);
isc_mem_free(dst__mctx, locks);
locks = NULL;
#endif
if (locks != NULL) {
CRYPTO_set_locking_callback(NULL);
- DESTROYMUTEXBLOCK(locks, nlocks);
+ isc_mutexblock_destroy(locks, nlocks);
isc_mem_free(dst__mctx, locks);
locks = NULL;
}
isc_mem_put(portlist->mctx, portlist->list,
portlist->allocated *
sizeof(*portlist->list));
- DESTROYLOCK(&portlist->lock);
+ isc_mutex_destroy(&portlist->lock);
isc_mem_putanddetach(&portlist->mctx, portlist,
sizeof(*portlist));
}
REQUIRE(requestmgr->eref == 0);
REQUIRE(requestmgr->iref == 0);
- DESTROYLOCK(&requestmgr->lock);
+ isc_mutex_destroy(&requestmgr->lock);
for (i = 0; i < DNS_REQUEST_NLOCKS; i++)
- DESTROYLOCK(&requestmgr->locks[i]);
+ isc_mutex_destroy(&requestmgr->locks[i]);
if (requestmgr->dispatchv4 != NULL)
dns_dispatch_detach(&requestmgr->dispatchv4);
if (requestmgr->dispatchv6 != NULL)
INSIST(res->nfctx == 0);
- DESTROYLOCK(&res->primelock);
- DESTROYLOCK(&res->nlock);
- DESTROYLOCK(&res->lock);
+ isc_mutex_destroy(&res->primelock);
+ isc_mutex_destroy(&res->nlock);
+ isc_mutex_destroy(&res->lock);
for (i = 0; i < res->nbuckets; i++) {
INSIST(ISC_LIST_EMPTY(res->buckets[i].fctxs));
isc_task_shutdown(res->buckets[i].task);
isc_task_detach(&res->buckets[i].task);
- DESTROYLOCK(&res->buckets[i].lock);
+ isc_mutex_destroy(&res->buckets[i].lock);
isc_mem_detach(&res->buckets[i].mctx);
}
isc_mem_put(res->mctx, res->buckets,
for (i = 0; i < RES_DOMAIN_BUCKETS; i++) {
INSIST(ISC_LIST_EMPTY(res->dbuckets[i].list));
isc_mem_detach(&res->dbuckets[i].mctx);
- DESTROYLOCK(&res->dbuckets[i].lock);
+ isc_mutex_destroy(&res->dbuckets[i].lock);
}
isc_mem_put(res->mctx, res->dbuckets,
RES_DOMAIN_BUCKETS * sizeof(zonebucket_t));
res->buckets[i].task = NULL;
result = isc_task_create(taskmgr, 0, &res->buckets[i].task);
if (result != ISC_R_SUCCESS) {
- DESTROYLOCK(&res->buckets[i].lock);
+ isc_mutex_destroy(&res->buckets[i].lock);
goto cleanup_buckets;
}
res->buckets[i].mctx = NULL;
result = isc_mem_create(0, 0, &res->buckets[i].mctx);
if (result != ISC_R_SUCCESS) {
isc_task_detach(&res->buckets[i].task);
- DESTROYLOCK(&res->buckets[i].lock);
+ isc_mutex_destroy(&res->buckets[i].lock);
goto cleanup_buckets;
}
isc_mem_setname(res->buckets[i].mctx, name, NULL);
#endif
cleanup_primelock:
- DESTROYLOCK(&res->primelock);
- DESTROYLOCK(&res->nlock);
- DESTROYLOCK(&res->lock);
+ isc_mutex_destroy(&res->primelock);
+ isc_mutex_destroy(&res->nlock);
+ isc_mutex_destroy(&res->lock);
if (res->dispatches6 != NULL)
dns_dispatchset_destroy(&res->dispatches6);
dns_dispatchset_destroy(&res->dispatches4);
for (i = 0; i < dbuckets_created; i++) {
- DESTROYLOCK(&res->dbuckets[i].lock);
+ isc_mutex_destroy(&res->dbuckets[i].lock);
isc_mem_detach(&res->dbuckets[i].mctx);
}
isc_mem_put(view->mctx, res->dbuckets,
cleanup_buckets:
for (i = 0; i < buckets_created; i++) {
isc_mem_detach(&res->buckets[i].mctx);
- DESTROYLOCK(&res->buckets[i].lock);
+ isc_mutex_destroy(&res->buckets[i].lock);
isc_task_shutdown(res->buckets[i].task);
isc_task_detach(&res->buckets[i].task);
}
INSIST(isc_refcount_decrement(&zones->refs) > 0);
isc_refcount_destroy(&zones->refs);
- DESTROYLOCK(&zones->maint_lock);
+ isc_mutex_destroy(&zones->maint_lock);
isc_rwlock_destroy(&zones->search_lock);
if (rpzs->rbt != NULL) {
dns_rbt_destroy(&rpzs->rbt);
}
- DESTROYLOCK(&rpzs->maint_lock);
+ isc_mutex_destroy(&rpzs->maint_lock);
isc_rwlock_destroy(&rpzs->search_lock);
isc_refcount_destroy(&rpzs->refs);
isc_mem_putanddetach(&rpzs->mctx, rpzs, sizeof(*rpzs));
if (rrl->exempt != NULL)
dns_acl_detach(&rrl->exempt);
- DESTROYLOCK(&rrl->lock);
+ isc_mutex_destroy(&rrl->lock);
while (!ISC_LIST_EMPTY(rrl->blocks)) {
b = ISC_LIST_HEAD(rrl->blocks);
return (ISC_R_SUCCESS);
cleanup_mutex:
- DESTROYLOCK(&imp->driverlock);
+ isc_mutex_destroy(&imp->driverlock);
isc_mem_put(mctx, imp, sizeof(dns_sdbimplementation_t));
return (result);
}
imp = *sdbimp;
dns_db_unregister(&imp->dbimp);
- DESTROYLOCK(&imp->driverlock);
+ isc_mutex_destroy(&imp->driverlock);
mctx = imp->mctx;
isc_mem_put(mctx, imp, sizeof(dns_sdbimplementation_t));
}
isc_mem_free(mctx, sdb->zone);
- DESTROYLOCK(&sdb->lock);
+ isc_mutex_destroy(&sdb->lock);
sdb->common.magic = 0;
sdb->common.impmagic = 0;
dns_name_free(node->name, mctx);
isc_mem_put(mctx, node->name, sizeof(dns_name_t));
}
- DESTROYLOCK(&node->lock);
+ isc_mutex_destroy(&node->lock);
node->magic = 0;
isc_mem_put(mctx, node, sizeof(dns_sdbnode_t));
detach((dns_db_t **) (void *)&sdb);
cleanup_origin:
dns_name_free(&sdb->common.origin, mctx);
cleanup_lock:
- (void)isc_mutex_destroy(&sdb->lock);
+ isc_mutex_destroy(&sdb->lock);
isc_mem_put(mctx, sdb, sizeof(dns_sdb_t));
isc_mem_detach(&mctx);
sdlz->common.magic = 0;
sdlz->common.impmagic = 0;
- (void)isc_mutex_destroy(&sdlz->refcnt_lock);
+ isc_mutex_destroy(&sdlz->refcnt_lock);
dns_name_free(&sdlz->common.origin, mctx);
dns_name_free(node->name, mctx);
isc_mem_put(mctx, node->name, sizeof(dns_name_t));
}
- DESTROYLOCK(&node->lock);
+ isc_mutex_destroy(&node->lock);
node->magic = 0;
isc_mem_put(mctx, node, sizeof(dns_sdlznode_t));
db = &sdlz->common;
cleanup_mutex:
/* destroy the driver lock, we don't need it anymore */
- DESTROYLOCK(&imp->driverlock);
+ isc_mutex_destroy(&imp->driverlock);
/*
* return the memory back to the available memory pool and
dns_dlzunregister(&imp->dlz_imp);
/* destroy the driver lock, we don't need it anymore */
- DESTROYLOCK(&imp->driverlock);
+ isc_mutex_destroy(&imp->driverlock);
mctx = imp->mctx;
rule->magic = 0;
isc_mem_put(mctx, rule, sizeof(dns_ssurule_t));
}
- DESTROYLOCK(&table->lock);
+ isc_mutex_destroy(&table->lock);
table->magic = 0;
isc_mem_putanddetach(&table->mctx, table, sizeof(dns_ssutable_t));
}
if (stats->references == 0) {
isc_stats_detach(&stats->counters);
- DESTROYLOCK(&stats->lock);
+ isc_mutex_destroy(&stats->lock);
isc_mem_putanddetach(&stats->mctx, stats, sizeof(*stats));
}
}
return (ISC_R_SUCCESS);
clean_mutex:
- DESTROYLOCK(&stats->lock);
+ isc_mutex_destroy(&stats->lock);
isc_mem_put(mctx, stats, sizeof(*stats));
return (result);
return (ISC_R_SUCCESS);
cleanup_mutex:
- DESTROYLOCK(&val->lock);
+ isc_mutex_destroy(&val->lock);
isc_task_detach(&tclone);
isc_event_free(ISC_EVENT_PTR(&event));
mctx = val->view->mctx;
if (val->siginfo != NULL)
isc_mem_put(mctx, val->siginfo, sizeof(*val->siginfo));
- DESTROYLOCK(&val->lock);
+ isc_mutex_destroy(&val->lock);
dns_view_weakdetach(&val->view);
val->magic = 0;
isc_mem_put(mctx, val, sizeof(*val));
}
cleanup_new_zone_lock:
- DESTROYLOCK(&view->new_zone_lock);
+ isc_mutex_destroy(&view->new_zone_lock);
dns_badcache_destroy(&view->failcache);
}
cleanup_mutex:
- DESTROYLOCK(&view->lock);
+ isc_mutex_destroy(&view->lock);
if (view->nta_file != NULL) {
isc_mem_free(mctx, view->nta_file);
dns_aclenv_destroy(&view->aclenv);
if (view->failcache != NULL)
dns_badcache_destroy(&view->failcache);
- DESTROYLOCK(&view->new_zone_lock);
- DESTROYLOCK(&view->lock);
+ isc_mutex_destroy(&view->new_zone_lock);
+ isc_mutex_destroy(&view->lock);
isc_mem_free(view->mctx, view->nta_file);
isc_mem_free(view->mctx, view->name);
isc_mem_putanddetach(&view->mctx, view, sizeof(*view));
ZONEDB_DESTROYLOCK(&zone->dblock);
free_mutex:
- DESTROYLOCK(&zone->lock);
+ isc_mutex_destroy(&zone->lock);
isc_mem_putanddetach(&zone->mctx, zone, sizeof(*zone));
return (result);
/* last stuff */
ZONEDB_DESTROYLOCK(&zone->dblock);
- DESTROYLOCK(&zone->lock);
+ isc_mutex_destroy(&zone->lock);
zone->magic = 0;
mctx = zone->mctx;
isc_mem_put(mctx, zone, sizeof(*zone));
#if 0
free_iolock:
- DESTROYLOCK(&zmgr->iolock);
+ isc_mutex_destroy(&zmgr->iolock);
#endif
free_startupnotifyrl:
isc_ratelimiter_detach(&zmgr->startupnotifyrl);
zmgr->magic = 0;
- DESTROYLOCK(&zmgr->iolock);
+ isc_mutex_destroy(&zmgr->iolock);
isc_ratelimiter_detach(&zmgr->notifyrl);
isc_ratelimiter_detach(&zmgr->refreshrl);
isc_ratelimiter_detach(&zmgr->startupnotifyrl);
ISC_LIST_INIT(head.resstates);
result = make_resstates(mctx, hostname, &head, conf);
if (result != ISC_R_SUCCESS) {
- DESTROYLOCK(&head.list_lock);
+ isc_mutex_destroy(&head.list_lock);
return (EAI_FAIL);
}
irs_context_destroy(&irsctx);
#endif
- DESTROYLOCK(&head.list_lock);
+ isc_mutex_destroy(&head.list_lock);
return (error);
}
isc_task_detach(&httpdmgr->task);
isc_socket_detach(&httpdmgr->sock);
isc_mem_detach(&httpdmgr->mctx);
- (void)isc_mutex_destroy(&httpdmgr->lock);
+ isc_mutex_destroy(&httpdmgr->lock);
isc_mem_put(mctx, httpdmgr, sizeof(isc_httpdmgr_t));
return (result);
}
}
UNLOCK(&httpdmgr->lock);
- (void)isc_mutex_destroy(&httpdmgr->lock);
+ isc_mutex_destroy(&httpdmgr->lock);
if (httpdmgr->ondestroy != NULL)
(httpdmgr->ondestroy)(httpdmgr->cb_arg);
ISC_LANG_BEGINDECLS
-isc_result_t
+void
isc_mutexblock_init(isc_mutex_t *block, unsigned int count);
/*%<
* Initialize a block of locks. If an error occurs all initialized locks
*
*\li count > 0
*
- * Returns:
- *
- *\li Any code isc_mutex_init() can return is a valid return for this
- * function.
*/
-isc_result_t
+void
isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count);
/*%<
* Destroy a block of locks.
*\li Each lock in the block be initialized via isc_mutex_init() or
* the whole block was initialized via isc_mutex_initblock().
*
- * Returns:
- *
- *\li Any code isc_mutex_init() can return is a valid return for this
- * function.
*/
ISC_LANG_ENDDECLS
#define ISC_QUEUE_DESTROY(queue) \
do { \
ISC_QLINK_INSIST(ISC_QUEUE_EMPTY(queue)); \
- (void) isc_mutex_destroy(&(queue).taillock); \
- (void) isc_mutex_destroy(&(queue).headlock); \
+ isc_mutex_destroy(&(queue).taillock); \
+ isc_mutex_destroy(&(queue).headlock); \
} while (0)
/*
ISC_MSG_UNLOCKED, "UNLOCKED"), \
(lp), __FILE__, __LINE__)); \
} while (0)
-#define DESTROYLOCK(lp) \
- RUNTIME_CHECK(isc_mutex_destroy((lp)) == ISC_R_SUCCESS)
-
#define BROADCAST(cvp) do { \
ISC_UTIL_TRACE(fprintf(stderr, "%s %p %s %d\n", \
RUNTIME_CHECK(isc_rwlock_unlock((lp), (t)) == ISC_R_SUCCESS); \
} while (0)
-#define DESTROYMUTEXBLOCK(bp, n) \
- RUNTIME_CHECK(isc_mutexblock_destroy((bp), (n)) == ISC_R_SUCCESS)
-
/*
* List Macros.
*/
isc_logconfig_destroy(&lcfg);
}
- DESTROYLOCK(&lctx->lock);
+ isc_mutex_destroy(&lctx->lock);
while ((message = ISC_LIST_HEAD(lctx->messages)) != NULL) {
ISC_LIST_UNLINK(lctx->messages, message, link);
(ctx->memfree)(ctx->arg, ctx->debuglist);
#endif /* ISC_MEM_TRACKLINES */
if ((ctx->flags & ISC_MEMFLAG_NOLOCK) == 0)
- DESTROYLOCK(&ctx->lock);
+ isc_mutex_destroy(&ctx->lock);
(memfree)(arg, ctx);
}
}
if ((ctx->flags & ISC_MEMFLAG_NOLOCK) == 0)
- DESTROYLOCK(&ctx->lock);
+ isc_mutex_destroy(&ctx->lock);
ctx->malloced -= sizeof(*ctx);
if (ctx->checkfree)
INSIST(ctx->malloced == 0);
#include <isc/mutexblock.h>
#include <isc/util.h>
-isc_result_t
+void
isc_mutexblock_init(isc_mutex_t *block, unsigned int count) {
unsigned int i;
for (i = 0; i < count; i++) {
isc_mutex_init(&block[i]);
}
-
- return (ISC_R_SUCCESS);
}
-isc_result_t
+void
isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count) {
- isc_result_t result;
unsigned int i;
for (i = 0; i < count; i++) {
- result = isc_mutex_destroy(&block[i]);
- if (result != ISC_R_SUCCESS)
- return (result);
+ isc_mutex_destroy(&block[i]);
}
-
- return (ISC_R_SUCCESS);
}
#if ISC_MUTEX_PROFILE
#define isc_mutex_destroy(mp) \
- ((pthread_mutex_destroy((&(mp)->mutex)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+ (RUNTIME_CHECK(pthread_mutex_destroy((&(mp)->mutex)) == 0))
#else
#define isc_mutex_destroy(mp) \
- ((pthread_mutex_destroy((mp)) == 0) ? \
- ISC_R_SUCCESS : ISC_R_UNEXPECTED)
+ (RUNTIME_CHECK(pthread_mutex_destroy((mp)) == 0))
#endif
#if ISC_MUTEX_PROFILE
quota->max = 0;
quota->used = 0;
quota->soft = 0;
- DESTROYLOCK("a->lock);
+ isc_mutex_destroy("a->lock);
}
void
return (ISC_R_SUCCESS);
free_mutex:
- DESTROYLOCK(&rl->lock);
+ isc_mutex_destroy(&rl->lock);
isc_mem_put(mctx, rl, sizeof(*rl));
return (result);
}
static void
ratelimiter_free(isc_ratelimiter_t *rl) {
- DESTROYLOCK(&rl->lock);
+ isc_mutex_destroy(&rl->lock);
isc_mem_put(rl->mctx, rl, sizeof(*rl));
}
rwl->magic = 0;
(void)isc_condition_destroy(&rwl->readable);
(void)isc_condition_destroy(&rwl->writeable);
- DESTROYLOCK(&rwl->lock);
+ isc_mutex_destroy(&rwl->lock);
}
/*
isc_mem_put(mctx, stats->counters, sizeof(isc_stat_t) * ncounters);
clean_mutex:
- DESTROYLOCK(&stats->lock);
+ isc_mutex_destroy(&stats->lock);
isc_mem_put(mctx, stats, sizeof(*stats));
return (result);
isc_mem_put(stats->mctx, stats->counters,
sizeof(isc_stat_t) * stats->ncounters);
UNLOCK(&stats->lock);
- DESTROYLOCK(&stats->lock);
+ isc_mutex_destroy(&stats->lock);
isc_mem_putanddetach(&stats->mctx, stats, sizeof(*stats));
return;
}
*/
wake_all_queues(manager);
}
- DESTROYLOCK(&task->lock);
+ isc_mutex_destroy(&task->lock);
task->common.impmagic = 0;
task->common.magic = 0;
isc_mem_put(manager->mctx, task, sizeof(*task));
UNLOCK(&manager->lock);
if (exiting) {
- DESTROYLOCK(&task->lock);
+ isc_mutex_destroy(&task->lock);
isc_mem_put(manager->mctx, task, sizeof(*task));
return (ISC_R_SHUTTINGDOWN);
}
static void
manager_free(isc__taskmgr_t *manager) {
for (unsigned int i = 0; i < manager->workers; i++) {
- DESTROYLOCK(&manager->queues[i].lock);
+ isc_mutex_destroy(&manager->queues[i].lock);
}
- DESTROYLOCK(&manager->lock);
- DESTROYLOCK(&manager->halt_lock);
+ isc_mutex_destroy(&manager->lock);
+ isc_mutex_destroy(&manager->halt_lock);
isc_mem_put(manager->mctx, manager->queues,
manager->workers * sizeof(isc__taskqueue_t));
manager->common.impmagic = 0;
UNLOCK(&mx);
isc_task_detach(&task);
- DESTROYLOCK(&mx);
+ isc_mutex_destroy(&mx);
(void) isc_condition_destroy(&cv);
}
isc_timer_detach(&oncetimer);
isc_task_destroy(&task1);
isc_task_destroy(&task2);
- DESTROYLOCK(&mx);
+ isc_mutex_destroy(&mx);
}
int
UNLOCK(&manager->lock);
isc_task_detach(&timer->task);
- DESTROYLOCK(&timer->lock);
+ isc_mutex_destroy(&timer->lock);
timer->common.impmagic = 0;
timer->common.magic = 0;
isc_mem_put(manager->mctx, timer, sizeof(*timer));
if (result != ISC_R_SUCCESS) {
timer->common.impmagic = 0;
timer->common.magic = 0;
- DESTROYLOCK(&timer->lock);
+ isc_mutex_destroy(&timer->lock);
isc_task_detach(&timer->task);
isc_mem_put(manager->mctx, timer, sizeof(*timer));
return (result);
ISC_R_SUCCESS) {
isc_mem_detach(&manager->mctx);
(void)isc_condition_destroy(&manager->wakeup);
- DESTROYLOCK(&manager->lock);
+ isc_mutex_destroy(&manager->lock);
isc_heap_destroy(&manager->heap);
isc_mem_put(mctx, manager, sizeof(*manager));
UNEXPECTED_ERROR(__FILE__, __LINE__,
* Clean up.
*/
(void)isc_condition_destroy(&manager->wakeup);
- DESTROYLOCK(&manager->lock);
+ isc_mutex_destroy(&manager->lock);
isc_heap_destroy(&manager->heap);
manager->common.impmagic = 0;
manager->common.magic = 0;
REQUIRE(VALID_APPCTX(ctx));
- DESTROYLOCK(&ctx->lock);
+ isc_mutex_destroy(&ctx->lock);
}
void
sock->common.magic = 0;
sock->common.impmagic = 0;
- DESTROYLOCK(&sock->lock);
+ isc_mutex_destroy(&sock->lock);
isc_mem_put(sock->manager->mctx, sock, sizeof(*sock));
if (thread->fdlock != NULL) {
for (i = 0; i < FDLOCK_COUNT; i++) {
- DESTROYLOCK(&thread->fdlock[i]);
+ isc_mutex_destroy(&thread->fdlock[i]);
}
isc_mem_put(thread->manager->mctx, thread->fdlock,
FDLOCK_COUNT * sizeof(isc_mutex_t));
if (manager->stats != NULL) {
isc_stats_detach(&manager->stats);
}
- DESTROYLOCK(&manager->lock);
+ isc_mutex_destroy(&manager->lock);
manager->common.magic = 0;
manager->common.impmagic = 0;
mctx= manager->mctx;
REQUIRE(VALID_APPCTX(ctx));
- DESTROYLOCK(&ctx->lock);
+ isc_mutex_destroy(&ctx->lock);
}
void
#define isc_mutex_trylock(mp) \
(TryEnterCriticalSection((mp)) ? ISC_R_SUCCESS : ISC_R_LOCKBUSY)
#define isc_mutex_destroy(mp) \
- (DeleteCriticalSection((mp)), ISC_R_SUCCESS)
+ (DeleteCriticalSection((mp)))
/*
* This is a placeholder for now since we are not keeping any mutex stats
lineno, sock->fd, &sock->lock, sock->lock.LockSemaphore);
sock->magic = 0;
- DESTROYLOCK(&sock->lock);
+ isc_mutex_destroy(&sock->lock);
if (sock->recvbuf.base != NULL)
isc_mem_put(manager->mctx, sock->recvbuf.base,
(void)isc_condition_destroy(&manager->shutdown_ok);
- DESTROYLOCK(&manager->lock);
+ isc_mutex_destroy(&manager->lock);
if (manager->stats != NULL)
isc_stats_detach(&manager->stats);
manager->magic = 0;
* Destroy the fetchlock mutex that was created in
* ns_query_init().
*/
- DESTROYLOCK(&client->query.fetchlock);
+ isc_mutex_destroy(&client->query.fetchlock);
if (client->sctx != NULL)
ns_server_detach(&client->sctx);
ISC_QUEUE_DESTROY(manager->inactive);
- DESTROYLOCK(&manager->lock);
- DESTROYLOCK(&manager->listlock);
- DESTROYLOCK(&manager->reclock);
+ isc_mutex_destroy(&manager->lock);
+ isc_mutex_destroy(&manager->listlock);
+ isc_mutex_destroy(&manager->reclock);
if (manager->excl != NULL)
isc_task_detach(&manager->excl);
return (ISC_R_SUCCESS);
cleanup_reclock:
- (void) isc_mutex_destroy(&manager->reclock);
- (void) isc_mutex_destroy(&manager->listlock);
- (void) isc_mutex_destroy(&manager->lock);
+ isc_mutex_destroy(&manager->reclock);
+ isc_mutex_destroy(&manager->listlock);
+ isc_mutex_destroy(&manager->lock);
isc_mem_put(manager->mctx, manager, sizeof(*manager));
ns_listenlist_detach(&mgr->listenon4);
ns_listenlist_detach(&mgr->listenon6);
clearlistenon(mgr);
- DESTROYLOCK(&mgr->lock);
+ isc_mutex_destroy(&mgr->lock);
if (mgr->sctx != NULL)
ns_server_detach(&mgr->sctx);
if (mgr->excl != NULL)
return (ISC_R_SUCCESS);
clientmgr_create_failure:
- DESTROYLOCK(&ifp->lock);
+ isc_mutex_destroy(&ifp->lock);
ifp->magic = 0;
isc_mem_put(mgr->mctx, ifp, sizeof(*ifp));
if (ifp->tcpsocket != NULL)
isc_socket_detach(&ifp->tcpsocket);
- DESTROYLOCK(&ifp->lock);
+ isc_mutex_destroy(&ifp->lock);
ns_interfacemgr_detach(&ifp->mgr);
query_reset(client, false);
result = query_newdbversion(client, 3);
if (result != ISC_R_SUCCESS) {
- DESTROYLOCK(&client->query.fetchlock);
+ isc_mutex_destroy(&client->query.fetchlock);
return (result);
}
result = query_newnamebuf(client);
if (result != ISC_R_SUCCESS) {
query_freefreeversions(client, true);
- DESTROYLOCK(&client->query.fetchlock);
+ isc_mutex_destroy(&client->query.fetchlock);
}
return (result);
if (stats->references == 0) {
isc_stats_detach(&stats->counters);
- DESTROYLOCK(&stats->lock);
+ isc_mutex_destroy(&stats->lock);
isc_mem_putanddetach(&stats->mctx, stats, sizeof(*stats));
}
}
return (ISC_R_SUCCESS);
clean_mutex:
- DESTROYLOCK(&stats->lock);
+ isc_mutex_destroy(&stats->lock);
isc_mem_put(mctx, stats, sizeof(*stats));
return (result);