diff --git a/lib/isc/include/isc/util.h b/lib/isc/include/isc/util.h index 7ad4895627..9d92cc5e8e 100644 --- a/lib/isc/include/isc/util.h +++ b/lib/isc/include/isc/util.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: util.h,v 1.17 2000/08/17 18:33:41 gson Exp $ */ +/* $Id: util.h,v 1.18 2000/08/26 01:23:17 bwelling Exp $ */ #ifndef ISC_UTIL_H #define ISC_UTIL_H 1 @@ -94,6 +94,10 @@ (lp), __FILE__, __LINE__)); \ } while (0) #define ISLOCKED(lp) (1) +#define DESTROYLOCK(lp) do { \ + RUNTIME_CHECK(isc_mutex_destroy((lp)) == ISC_R_SUCCESS); \ + } while (0); + #define BROADCAST(cvp) do { \ ISC_UTIL_TRACE(fprintf(stderr, "BROADCAST %p %s %d\n", \ diff --git a/lib/isc/log.c b/lib/isc/log.c index 5d80930ea9..7cddc164d6 100644 --- a/lib/isc/log.c +++ b/lib/isc/log.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: log.c,v 1.44 2000/08/24 23:22:40 bwelling Exp $ */ +/* $Id: log.c,v 1.45 2000/08/26 01:23:11 bwelling Exp $ */ /* Principal Authors: DCL */ @@ -446,7 +446,7 @@ isc_log_destroy(isc_log_t **lctxp) { isc_logconfig_destroy(&lcfg); } - RUNTIME_CHECK(isc_mutex_destroy(&lctx->lock) == ISC_R_SUCCESS); + DESTROYLOCK(&lctx->lock); while ((message = ISC_LIST_HEAD(lctx->messages)) != NULL) { ISC_LIST_UNLINK(lctx->messages, message, link); diff --git a/lib/isc/mem.c b/lib/isc/mem.c index a999dcb0a5..833d47f68f 100644 --- a/lib/isc/mem.c +++ b/lib/isc/mem.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mem.c,v 1.59 2000/08/09 23:03:15 bwelling Exp $ */ +/* $Id: mem.c,v 1.60 2000/08/26 01:23:12 bwelling Exp $ */ #include @@ -705,7 +705,7 @@ destroy(isc_mem_t *ctx) { ondest = ctx->ondestroy; - (void)isc_mutex_destroy(&ctx->lock); + DESTROYLOCK(&ctx->lock); (ctx->memfree)(ctx->arg, ctx); isc_ondestroy_notify(&ondest, ctx); diff --git a/lib/isc/mutexblock.c b/lib/isc/mutexblock.c index d57066d2bc..2178350651 100644 --- a/lib/isc/mutexblock.c +++ b/lib/isc/mutexblock.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mutexblock.c,v 1.10 2000/08/01 01:29:35 tale Exp $ */ +/* $Id: mutexblock.c,v 1.11 2000/08/26 01:23:16 bwelling Exp $ */ #include @@ -31,7 +31,7 @@ isc_mutexblock_init(isc_mutex_t *block, unsigned int count) { if (result != ISC_R_SUCCESS) { i--; while (i > 0) { - isc_mutex_destroy(&block[i]); + DESTROYLOCK(&block[i]); i--; } return (result); @@ -47,7 +47,7 @@ isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count) { unsigned int i; for (i = 0 ; i < count ; i++) { - result = isc_mutex_destroy(&block[i]); + DESTROYLOCK(&block[i]); if (result != ISC_R_SUCCESS) return (result); } diff --git a/lib/isc/quota.c b/lib/isc/quota.c index 5e7d2d885b..4285fc957f 100644 --- a/lib/isc/quota.c +++ b/lib/isc/quota.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: quota.c,v 1.9 2000/08/24 23:26:12 bwelling Exp $ */ +/* $Id: quota.c,v 1.10 2000/08/26 01:23:13 bwelling Exp $ */ #include @@ -36,7 +36,7 @@ isc_quota_destroy(isc_quota_t *quota) { INSIST(quota->used == 0); quota->max = -1; quota->used = -1; - RUNTIME_CHECK(isc_mutex_destroy("a->lock) == ISC_R_SUCCESS); + DESTROYLOCK("a->lock); } isc_result_t diff --git a/lib/isc/random.c b/lib/isc/random.c index 43e85795f6..613e153f7b 100644 --- a/lib/isc/random.c +++ b/lib/isc/random.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: random.c,v 1.9 2000/08/01 01:29:41 tale Exp $ */ +/* $Id: random.c,v 1.10 2000/08/26 01:23:14 bwelling Exp $ */ #include @@ -63,7 +63,8 @@ isc_random_invalidate(isc_random_t *r) REQUIRE(ISC_RANDOM_VALID(r)); #if 0 - result = isc_mutex_destroy(&r->lock); + DESTROYLOCK(&r->lock); + result = ISC_R_SUCCESS; #else result = ISC_R_SUCCESS; #endif