Commit 6714319d authored by Brian Wellington's avatar Brian Wellington
Browse files

Add a DESTROYLOCK macro to wrap isc_mutex_destroy()

parent bba01d37
......@@ -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", \
......
......@@ -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);
......
......@@ -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 <config.h>
......@@ -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);
......
......@@ -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 <config.h>
......@@ -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);
}
......
......@@ -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 <config.h>
......@@ -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(&quota->lock) == ISC_R_SUCCESS);
DESTROYLOCK(&quota->lock);
}
isc_result_t
......
......@@ -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 <config.h>
......@@ -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
......
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