mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 07:35:26 +00:00
Add a DESTROYLOCK macro to wrap isc_mutex_destroy()
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* 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
|
#ifndef ISC_UTIL_H
|
||||||
#define ISC_UTIL_H 1
|
#define ISC_UTIL_H 1
|
||||||
@@ -94,6 +94,10 @@
|
|||||||
(lp), __FILE__, __LINE__)); \
|
(lp), __FILE__, __LINE__)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define ISLOCKED(lp) (1)
|
#define ISLOCKED(lp) (1)
|
||||||
|
#define DESTROYLOCK(lp) do { \
|
||||||
|
RUNTIME_CHECK(isc_mutex_destroy((lp)) == ISC_R_SUCCESS); \
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
|
||||||
#define BROADCAST(cvp) do { \
|
#define BROADCAST(cvp) do { \
|
||||||
ISC_UTIL_TRACE(fprintf(stderr, "BROADCAST %p %s %d\n", \
|
ISC_UTIL_TRACE(fprintf(stderr, "BROADCAST %p %s %d\n", \
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* 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 */
|
/* Principal Authors: DCL */
|
||||||
|
|
||||||
@@ -446,7 +446,7 @@ isc_log_destroy(isc_log_t **lctxp) {
|
|||||||
isc_logconfig_destroy(&lcfg);
|
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) {
|
while ((message = ISC_LIST_HEAD(lctx->messages)) != NULL) {
|
||||||
ISC_LIST_UNLINK(lctx->messages, message, link);
|
ISC_LIST_UNLINK(lctx->messages, message, link);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* 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>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -705,7 +705,7 @@ destroy(isc_mem_t *ctx) {
|
|||||||
|
|
||||||
ondest = ctx->ondestroy;
|
ondest = ctx->ondestroy;
|
||||||
|
|
||||||
(void)isc_mutex_destroy(&ctx->lock);
|
DESTROYLOCK(&ctx->lock);
|
||||||
(ctx->memfree)(ctx->arg, ctx);
|
(ctx->memfree)(ctx->arg, ctx);
|
||||||
|
|
||||||
isc_ondestroy_notify(&ondest, ctx);
|
isc_ondestroy_notify(&ondest, ctx);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* 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>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ isc_mutexblock_init(isc_mutex_t *block, unsigned int count) {
|
|||||||
if (result != ISC_R_SUCCESS) {
|
if (result != ISC_R_SUCCESS) {
|
||||||
i--;
|
i--;
|
||||||
while (i > 0) {
|
while (i > 0) {
|
||||||
isc_mutex_destroy(&block[i]);
|
DESTROYLOCK(&block[i]);
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
return (result);
|
return (result);
|
||||||
@@ -47,7 +47,7 @@ isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count) {
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0 ; i < count ; i++) {
|
for (i = 0 ; i < count ; i++) {
|
||||||
result = isc_mutex_destroy(&block[i]);
|
DESTROYLOCK(&block[i]);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* 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>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ isc_quota_destroy(isc_quota_t *quota) {
|
|||||||
INSIST(quota->used == 0);
|
INSIST(quota->used == 0);
|
||||||
quota->max = -1;
|
quota->max = -1;
|
||||||
quota->used = -1;
|
quota->used = -1;
|
||||||
RUNTIME_CHECK(isc_mutex_destroy("a->lock) == ISC_R_SUCCESS);
|
DESTROYLOCK("a->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* 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>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -63,7 +63,8 @@ isc_random_invalidate(isc_random_t *r)
|
|||||||
REQUIRE(ISC_RANDOM_VALID(r));
|
REQUIRE(ISC_RANDOM_VALID(r));
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
result = isc_mutex_destroy(&r->lock);
|
DESTROYLOCK(&r->lock);
|
||||||
|
result = ISC_R_SUCCESS;
|
||||||
#else
|
#else
|
||||||
result = ISC_R_SUCCESS;
|
result = ISC_R_SUCCESS;
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user