Commit 5e387b9c authored by Brian Wellington's avatar Brian Wellington
Browse files

and more calls to DESTROYLOCK

parent a4403827
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: adb.c,v 1.147 2000/08/11 16:47:27 gson Exp $ */
/* $Id: adb.c,v 1.148 2000/08/26 01:36:45 bwelling Exp $ */
/*
* Implementation notes
......@@ -1647,7 +1647,7 @@ free_adbfind(dns_adb_t *adb, dns_adbfind_t **findp) {
find->magic = 0;
isc_mutex_destroy(&find->lock);
DESTROYLOCK(&find->lock);
isc_mempool_put(adb->ahmp, find);
}
......@@ -2105,9 +2105,9 @@ destroy(dns_adb_t *adb) {
isc_mutexblock_destroy(adb->entrylocks, NBUCKETS);
isc_mutexblock_destroy(adb->namelocks, NBUCKETS);
isc_mutex_destroy(&adb->ilock);
isc_mutex_destroy(&adb->lock);
isc_mutex_destroy(&adb->mplock);
DESTROYLOCK(&adb->ilock);
DESTROYLOCK(&adb->lock);
DESTROYLOCK(&adb->mplock);
isc_random_invalidate(&adb->rand);
......@@ -2288,11 +2288,11 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_timermgr_t *timermgr,
if (adb->af6mp != NULL)
isc_mempool_destroy(&adb->af6mp);
isc_mutex_destroy(&adb->ilock);
DESTROYLOCK(&adb->ilock);
fail0d:
isc_mutex_destroy(&adb->mplock);
DESTROYLOCK(&adb->mplock);
fail0c:
isc_mutex_destroy(&adb->lock);
DESTROYLOCK(&adb->lock);
fail0b:
isc_random_invalidate(&adb->rand);
fail0a:
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: byaddr.c,v 1.20 2000/08/16 22:21:17 gson Exp $ */
/* $Id: byaddr.c,v 1.21 2000/08/26 01:36:46 bwelling Exp $ */
#include <config.h>
......@@ -431,7 +431,7 @@ dns_byaddr_create(isc_mem_t *mctx, isc_netaddr_t *address, dns_view_t *view,
return (ISC_R_SUCCESS);
cleanup_lock:
isc_mutex_destroy(&byaddr->lock);
DESTROYLOCK(&byaddr->lock);
cleanup_event:
ievent = (isc_event_t *)byaddr->event;
......@@ -474,7 +474,7 @@ dns_byaddr_destroy(dns_byaddr_t **byaddrp) {
REQUIRE(byaddr->task == NULL);
REQUIRE(byaddr->view == NULL);
isc_mutex_destroy(&byaddr->lock);
DESTROYLOCK(&byaddr->lock);
byaddr->magic = 0;
isc_mem_put(byaddr->mctx, byaddr, sizeof *byaddr);
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: cache.c,v 1.28 2000/08/18 22:32:45 gson Exp $ */
/* $Id: cache.c,v 1.29 2000/08/26 01:36:47 bwelling Exp $ */
#include <config.h>
......@@ -172,7 +172,7 @@ dns_cache_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
cleanup_db:
dns_db_detach(&cache->db);
cleanup_mutex:
isc_mutex_destroy(&cache->lock);
DESTROYLOCK(&cache->lock);
cleanup_mem:
isc_mem_put(mctx, cache, sizeof *cache);
isc_mem_detach(&mctx);
......@@ -203,7 +203,7 @@ cache_free(dns_cache_t *cache) {
if (cache->db)
dns_db_detach(&cache->db);
isc_mutex_destroy(&cache->lock);
DESTROYLOCK(&cache->lock);
cache->magic = 0;
mctx = cache->mctx;
isc_mem_put(cache->mctx, cache, sizeof *cache);
......
......@@ -16,7 +16,7 @@
*/
/*
* $Id: dbtable.c,v 1.21 2000/08/11 16:47:29 gson Exp $
* $Id: dbtable.c,v 1.22 2000/08/26 01:36:48 bwelling Exp $
*/
/*
......@@ -110,7 +110,7 @@ dns_dbtable_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
return (ISC_R_SUCCESS);
clean3:
(void)isc_mutex_destroy(&dbtable->lock);
DESTROYLOCK(&dbtable->lock);
clean2:
dns_rbt_destroy(&dbtable->rbt);
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dispatch.c,v 1.63 2000/08/24 16:56:48 gson Exp $ */
/* $Id: dispatch.c,v 1.64 2000/08/26 01:36:49 bwelling Exp $ */
#include <config.h>
......@@ -938,14 +938,14 @@ destroy_mgr(dns_dispatchmgr_t **mgrp) {
mgr->magic = 0;
mgr->mctx = 0;
isc_mutex_destroy(&mgr->lock);
DESTROYLOCK(&mgr->lock);
mgr->state = 0;
isc_mempool_destroy(&mgr->epool);
isc_mempool_destroy(&mgr->rpool);
isc_mempool_destroy(&mgr->dpool);
isc_mutex_destroy(&mgr->pool_lock);
DESTROYLOCK(&mgr->pool_lock);
if (mgr->entropy != NULL)
isc_entropy_detach(&mgr->entropy);
......@@ -1059,9 +1059,9 @@ dns_dispatchmgr_create(isc_mem_t *mctx, isc_entropy_t *entropy,
kill_epool:
isc_mempool_destroy(&mgr->epool);
kill_pool_lock:
isc_mutex_destroy(&mgr->pool_lock);
DESTROYLOCK(&mgr->pool_lock);
kill_lock:
isc_mutex_destroy(&mgr->lock);
DESTROYLOCK(&mgr->lock);
deallocate:
isc_mem_put(mctx, mgr, sizeof(dns_dispatchmgr_t));
isc_mem_detach(&mgr->mctx);
......@@ -1280,7 +1280,7 @@ dispatch_allocate(dns_dispatchmgr_t *mgr, unsigned int buffersize,
kill_bpool:
isc_mempool_destroy(&disp->bpool);
kill_lock:
isc_mutex_destroy(&disp->lock);
DESTROYLOCK(&disp->lock);
deallocate_qidtable:
isc_mem_put(mgr->mctx, disp->qid_table,
disp->qid_nbuckets * sizeof(dns_displist_t));
......@@ -1332,7 +1332,7 @@ dispatch_free(dns_dispatch_t **dispp)
disp->failsafe_ev = NULL;
isc_mempool_destroy(&disp->bpool);
isc_mutex_destroy(&disp->lock);
DESTROYLOCK(&disp->lock);
isc_mem_put(mgr->mctx, disp->qid_table,
disp->qid_nbuckets * sizeof(dns_displist_t));
disp->mgr = NULL;
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: keytable.c,v 1.21 2000/08/01 01:22:26 tale Exp $ */
/* $Id: keytable.c,v 1.22 2000/08/26 01:36:50 bwelling Exp $ */
#include <config.h>
......@@ -113,7 +113,7 @@ dns_keytable_create(isc_mem_t *mctx, dns_keytable_t **keytablep) {
return (ISC_R_SUCCESS);
cleanup_lock:
isc_mutex_destroy(&keytable->lock);
DESTROYLOCK(&keytable->lock);
cleanup_rbt:
dns_rbt_destroy(&keytable->table);
......@@ -173,7 +173,7 @@ dns_keytable_detach(dns_keytable_t **keytablep) {
if (destroy) {
dns_rbt_destroy(&keytable->table);
isc_rwlock_destroy(&keytable->rwlock);
isc_mutex_destroy(&keytable->lock);
DESTROYLOCK(&keytable->lock);
keytable->magic = 0;
isc_mem_put(keytable->mctx, keytable, sizeof *keytable);
}
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rbtdb.c,v 1.120 2000/08/18 18:25:26 bwelling Exp $ */
/* $Id: rbtdb.c,v 1.121 2000/08/26 01:36:52 bwelling Exp $ */
/*
* Principal Author: Bob Halley
......@@ -335,11 +335,11 @@ free_rbtdb(dns_rbtdb_t *rbtdb) {
if (rbtdb->tree != NULL)
dns_rbt_destroy(&rbtdb->tree);
for (i = 0; i < rbtdb->node_lock_count; i++)
isc_mutex_destroy(&rbtdb->node_locks[i].lock);
DESTROYLOCK(&rbtdb->node_locks[i].lock);
isc_mem_put(rbtdb->common.mctx, rbtdb->node_locks,
rbtdb->node_lock_count * sizeof (rbtdb_nodelock_t));
isc_rwlock_destroy(&rbtdb->tree_lock);
isc_mutex_destroy(&rbtdb->lock);
DESTROYLOCK(&rbtdb->lock);
rbtdb->common.magic = 0;
rbtdb->common.impmagic = 0;
ondest = rbtdb->common.ondest;
......@@ -3904,7 +3904,7 @@ dns_rbtdb_create
result = isc_rwlock_init(&rbtdb->tree_lock, 0, 0);
if (result != ISC_R_SUCCESS) {
isc_mutex_destroy(&rbtdb->lock);
DESTROYLOCK(&rbtdb->lock);
isc_mem_put(mctx, rbtdb, sizeof *rbtdb);
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_rwlock_init() failed: %s",
......@@ -3923,14 +3923,14 @@ dns_rbtdb_create
if (result != ISC_R_SUCCESS) {
i--;
while (i >= 0) {
isc_mutex_destroy(&rbtdb->node_locks[i].lock);
DESTROYLOCK(&rbtdb->node_locks[i].lock);
i--;
}
isc_mem_put(mctx, rbtdb->node_locks,
rbtdb->node_lock_count *
sizeof (rbtdb_nodelock_t));
isc_rwlock_destroy(&rbtdb->tree_lock);
isc_mutex_destroy(&rbtdb->lock);
DESTROYLOCK(&rbtdb->lock);
isc_mem_put(mctx, rbtdb, sizeof *rbtdb);
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mutex_init() failed: %s",
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: request.c,v 1.35 2000/08/23 19:46:58 bwelling Exp $ */
/* $Id: request.c,v 1.36 2000/08/26 01:36:53 bwelling Exp $ */
#include <config.h>
......@@ -161,8 +161,8 @@ dns_requestmgr_create(isc_mem_t *mctx,
result = isc_mutex_init(&requestmgr->locks[i]);
if (result != ISC_R_SUCCESS) {
while (--i >= 0)
isc_mutex_destroy(&requestmgr->locks[i]);
isc_mutex_destroy(&requestmgr->lock);
DESTROYLOCK(&requestmgr->locks[i]);
DESTROYLOCK(&requestmgr->lock);
isc_mem_put(mctx, requestmgr, sizeof(*requestmgr));
return (result);
}
......@@ -384,9 +384,9 @@ mgr_destroy(dns_requestmgr_t *requestmgr) {
REQUIRE(requestmgr->eref == 0);
REQUIRE(requestmgr->iref == 0);
isc_mutex_destroy(&requestmgr->lock);
DESTROYLOCK(&requestmgr->lock);
for (i = 0; i < DNS_REQUEST_NLOCKS; i++)
isc_mutex_destroy(&requestmgr->locks[i]);
DESTROYLOCK(&requestmgr->locks[i]);
if (requestmgr->dispatchv4 != NULL)
dns_dispatch_detach(&requestmgr->dispatchv4);
if (requestmgr->dispatchv6 != NULL)
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: resolver.c,v 1.166 2000/08/24 22:15:33 bwelling Exp $ */
/* $Id: resolver.c,v 1.167 2000/08/26 01:36:54 bwelling Exp $ */
#include <config.h>
......@@ -4185,12 +4185,12 @@ destroy(dns_resolver_t *res) {
RTRACE("destroy");
isc_mutex_destroy(&res->lock);
DESTROYLOCK(&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);
isc_mutex_destroy(&res->buckets[i].lock);
DESTROYLOCK(&res->buckets[i].lock);
}
isc_mem_put(res->mctx, res->buckets,
res->nbuckets * sizeof (fctxbucket_t));
......@@ -4290,7 +4290,7 @@ dns_resolver_create(dns_view_t *view,
res->buckets[i].task = NULL;
result = isc_task_create(taskmgr, 0, &res->buckets[i].task);
if (result != ISC_R_SUCCESS) {
isc_mutex_destroy(&res->buckets[i].lock);
DESTROYLOCK(&res->buckets[i].lock);
goto cleanup_buckets;
}
sprintf(name, "res%u", i);
......@@ -4332,7 +4332,7 @@ dns_resolver_create(dns_view_t *view,
cleanup_buckets:
for (i = 0; i < buckets_created; i++) {
(void)isc_mutex_destroy(&res->buckets[i].lock);
DESTROYLOCK(&res->buckets[i].lock);
isc_task_shutdown(res->buckets[i].task);
isc_task_detach(&res->buckets[i].task);
}
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sdb.c,v 1.7 2000/08/23 18:45:13 bwelling Exp $ */
/* $Id: sdb.c,v 1.8 2000/08/26 01:36:55 bwelling Exp $ */
#include <config.h>
......@@ -455,7 +455,7 @@ destroy(dns_sdb_t *sdb) {
&sdb->dbdata);
isc_mem_free(mctx, sdb->zone);
isc_mutex_destroy(&sdb->lock);
DESTROYLOCK(&sdb->lock);
sdb->common.magic = 0;
sdb->common.impmagic = 0;
......@@ -612,7 +612,7 @@ destroynode(dns_sdbnode_t *node) {
dns_name_free(node->name, mctx);
isc_mem_put(mctx, node->name, sizeof(dns_name_t));
}
isc_mutex_destroy(&node->lock);
DESTROYLOCK(&node->lock);
node->magic = 0;
isc_mem_put(mctx, node, sizeof(dns_sdbnode_t));
detach((dns_db_t **)&sdb);
......
......@@ -16,7 +16,7 @@
*/
/*
* $Id: ssu.c,v 1.13 2000/08/01 01:22:55 tale Exp $
* $Id: ssu.c,v 1.14 2000/08/26 01:36:57 bwelling Exp $
* Principal Author: Brian Wellington
*/
......@@ -103,7 +103,7 @@ destroy(dns_ssutable_t *table) {
rule->magic = 0;
isc_mem_put(mctx, rule, sizeof(dns_ssurule_t));
}
isc_mutex_destroy(&table->lock);
DESTROYLOCK(&table->lock);
table->magic = 0;
isc_mem_put(mctx, table, sizeof(dns_ssutable_t));
}
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: validator.c,v 1.75 2000/08/15 01:22:33 bwelling Exp $ */
/* $Id: validator.c,v 1.76 2000/08/26 01:36:58 bwelling Exp $ */
#include <config.h>
......@@ -1502,7 +1502,7 @@ destroy(dns_validator_t *val) {
mctx = val->view->mctx;
if (val->siginfo != NULL)
isc_mem_put(mctx, val->siginfo, sizeof *val->siginfo);
isc_mutex_destroy(&val->lock);
DESTROYLOCK(&val->lock);
dns_view_weakdetach(&val->view);
val->magic = 0;
isc_mem_put(mctx, val, sizeof *val);
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: view.c,v 1.77 2000/08/24 22:15:34 bwelling Exp $ */
/* $Id: view.c,v 1.78 2000/08/26 01:36:59 bwelling Exp $ */
#include <config.h>
......@@ -198,7 +198,7 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
isc_rwlock_destroy(&view->conflock);
cleanup_mutex:
isc_mutex_destroy(&view->lock);
DESTROYLOCK(&view->lock);
cleanup_name:
isc_mem_free(mctx, view->name);
......@@ -247,7 +247,7 @@ destroy(dns_view_t *view) {
dns_keytable_detach(&view->trustedkeys);
dns_keytable_detach(&view->secroots);
dns_fwdtable_destroy(&view->fwdtable);
isc_mutex_destroy(&view->lock);
DESTROYLOCK(&view->lock);
isc_mem_free(view->mctx, view->name);
isc_mem_put(view->mctx, view, sizeof *view);
}
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.c,v 1.196 2000/08/25 04:42:49 marka Exp $ */
/* $Id: zone.c,v 1.197 2000/08/26 01:37:00 bwelling Exp $ */
#include <config.h>
......@@ -419,7 +419,7 @@ dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx) {
return (ISC_R_SUCCESS);
free_mutex:
isc_mutex_destroy(&zone->lock);
DESTROYLOCK(&zone->lock);
return (ISC_R_NOMEMORY);
}
......@@ -484,7 +484,7 @@ zone_free(dns_zone_t *zone) {
dns_ssutable_detach(&zone->ssutable);
/* last stuff */
isc_mutex_destroy(&zone->lock);
DESTROYLOCK(&zone->lock);
zone->magic = 0;
mctx = zone->mctx;
isc_mem_put(mctx, zone, sizeof *zone);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment