mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-24 23:57:30 -04:00
rem: dev: Cleanup isc/util.h header and friends
Cleanup short list macros from <isc/util.h>, remove two unused headers, move locking macros to respective headers and use only the C11 static assertion. Merge branch 'ondrej/cleanup-short-macros' into 'main' See merge request isc-projects/bind9!10196
This commit is contained in:
commit
239712df16
31 changed files with 122 additions and 458 deletions
|
|
@ -20,7 +20,6 @@
|
|||
#include <isc/attributes.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/loop.h>
|
||||
#include <isc/netaddr.h>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <isc/condition.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/loop.h>
|
||||
#include <isc/mutex.h>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ struct dyndb_implementation {
|
|||
dns_dyndb_destroy_t *destroy_func;
|
||||
char *name;
|
||||
void *inst;
|
||||
LINK(dyndb_implementation_t) link;
|
||||
ISC_LINK(dyndb_implementation_t) link;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -52,7 +52,7 @@ struct dyndb_implementation {
|
|||
* These are stored here so they can be cleaned up on shutdown.
|
||||
* (The order in which they are stored is not important.)
|
||||
*/
|
||||
static LIST(dyndb_implementation_t) dyndb_implementations;
|
||||
static ISC_LIST(dyndb_implementation_t) dyndb_implementations;
|
||||
|
||||
/* Locks dyndb_implementations. */
|
||||
static isc_mutex_t dyndb_lock;
|
||||
|
|
@ -60,7 +60,7 @@ static isc_mutex_t dyndb_lock;
|
|||
void
|
||||
dns__dyndb_initialize(void) {
|
||||
isc_mutex_init(&dyndb_lock);
|
||||
INIT_LIST(dyndb_implementations);
|
||||
ISC_LIST_INIT(dyndb_implementations);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -135,7 +135,7 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname,
|
|||
|
||||
isc_mem_attach(mctx, &imp->mctx);
|
||||
|
||||
INIT_LINK(imp, link);
|
||||
ISC_LINK_INIT(imp, link);
|
||||
|
||||
r = uv_dlopen(filename, &imp->handle);
|
||||
if (r != 0) {
|
||||
|
|
@ -225,7 +225,7 @@ dns_dyndb_load(const char *libname, const char *name, const char *parameters,
|
|||
CHECK(implementation->register_func(mctx, name, parameters, file, line,
|
||||
dctx, &implementation->inst));
|
||||
|
||||
APPEND(dyndb_implementations, implementation, link);
|
||||
ISC_LIST_APPEND(dyndb_implementations, implementation, link);
|
||||
result = ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
|
|
@ -245,10 +245,10 @@ dns_dyndb_cleanup(void) {
|
|||
dyndb_implementation_t *prev;
|
||||
|
||||
LOCK(&dyndb_lock);
|
||||
elem = TAIL(dyndb_implementations);
|
||||
elem = ISC_LIST_TAIL(dyndb_implementations);
|
||||
while (elem != NULL) {
|
||||
prev = PREV(elem, link);
|
||||
UNLINK(dyndb_implementations, elem, link);
|
||||
prev = ISC_LIST_PREV(elem, link);
|
||||
ISC_LIST_UNLINK(dyndb_implementations, elem, link);
|
||||
isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB,
|
||||
ISC_LOG_INFO, "unloading DynDB instance '%s'",
|
||||
elem->name);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <isc/log.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/mutex.h>
|
||||
#include <isc/mutexblock.h>
|
||||
#include <isc/result.h>
|
||||
#include <isc/string.h>
|
||||
#include <isc/thread.h>
|
||||
|
|
|
|||
|
|
@ -544,7 +544,7 @@ qpzone_destroy(qpzonedb_t *qpdb) {
|
|||
isc_refcount_decrementz(&qpdb->current_version->references);
|
||||
|
||||
isc_refcount_destroy(&qpdb->current_version->references);
|
||||
UNLINK(qpdb->open_versions, qpdb->current_version, link);
|
||||
ISC_LIST_UNLINK(qpdb->open_versions, qpdb->current_version, link);
|
||||
cds_wfs_destroy(&qpdb->current_version->glue_stack);
|
||||
isc_rwlock_destroy(&qpdb->current_version->rwlock);
|
||||
isc_mem_put(qpdb->common.mctx, qpdb->current_version,
|
||||
|
|
@ -723,7 +723,7 @@ dns__qpzone_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
|
|||
* Keep the current version in the open list so that list operation
|
||||
* won't happen in normal lookup operations.
|
||||
*/
|
||||
PREPEND(qpdb->open_versions, qpdb->current_version, link);
|
||||
ISC_LIST_PREPEND(qpdb->open_versions, qpdb->current_version, link);
|
||||
|
||||
qpdb->common.magic = DNS_DB_MAGIC;
|
||||
qpdb->common.impmagic = QPZONE_DB_MAGIC;
|
||||
|
|
@ -1125,13 +1125,13 @@ cleanup_nondirty(qpz_version_t *version, qpz_changedlist_t *cleanup_list) {
|
|||
*
|
||||
* The caller must be holding the database lock.
|
||||
*/
|
||||
for (changed = HEAD(version->changed_list); changed != NULL;
|
||||
for (changed = ISC_LIST_HEAD(version->changed_list); changed != NULL;
|
||||
changed = next_changed)
|
||||
{
|
||||
next_changed = NEXT(changed, link);
|
||||
next_changed = ISC_LIST_NEXT(changed, link);
|
||||
if (!changed->dirty) {
|
||||
UNLINK(version->changed_list, changed, link);
|
||||
APPEND(*cleanup_list, changed, link);
|
||||
ISC_LIST_UNLINK(version->changed_list, changed, link);
|
||||
ISC_LIST_APPEND(*cleanup_list, changed, link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1378,12 +1378,13 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
|||
(void)isc_refcount_current(
|
||||
&cur_version->references);
|
||||
if (cur_version->serial == qpdb->least_serial) {
|
||||
INSIST(EMPTY(
|
||||
INSIST(ISC_LIST_EMPTY(
|
||||
cur_version->changed_list));
|
||||
}
|
||||
UNLINK(qpdb->open_versions, cur_version, link);
|
||||
ISC_LIST_UNLINK(qpdb->open_versions,
|
||||
cur_version, link);
|
||||
}
|
||||
if (EMPTY(qpdb->open_versions)) {
|
||||
if (ISC_LIST_EMPTY(qpdb->open_versions)) {
|
||||
/*
|
||||
* We're going to become the least open
|
||||
* version.
|
||||
|
|
@ -1413,8 +1414,9 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
|||
*/
|
||||
if (cur_ref == 1) {
|
||||
cleanup_version = cur_version;
|
||||
APPENDLIST(version->changed_list,
|
||||
cleanup_version->changed_list, link);
|
||||
ISC_LIST_APPENDLIST(
|
||||
version->changed_list,
|
||||
cleanup_version->changed_list, link);
|
||||
}
|
||||
/*
|
||||
* Become the current version.
|
||||
|
|
@ -1433,8 +1435,8 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
|||
*/
|
||||
INSIST(isc_refcount_increment0(&version->references) ==
|
||||
0);
|
||||
PREPEND(qpdb->open_versions, qpdb->current_version,
|
||||
link);
|
||||
ISC_LIST_PREPEND(qpdb->open_versions,
|
||||
qpdb->current_version, link);
|
||||
resigned_list = version->resigned_list;
|
||||
ISC_LIST_INIT(version->resigned_list);
|
||||
} else {
|
||||
|
|
@ -1461,7 +1463,7 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
|||
* Find the version with the least serial
|
||||
* number greater than ours.
|
||||
*/
|
||||
least_greater = PREV(version, link);
|
||||
least_greater = ISC_LIST_PREV(version, link);
|
||||
if (least_greater == NULL) {
|
||||
least_greater = qpdb->current_version;
|
||||
}
|
||||
|
|
@ -1482,20 +1484,21 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
|||
* Add any unexecuted cleanups to
|
||||
* those of the least greater version.
|
||||
*/
|
||||
APPENDLIST(least_greater->changed_list,
|
||||
version->changed_list, link);
|
||||
ISC_LIST_APPENDLIST(least_greater->changed_list,
|
||||
version->changed_list,
|
||||
link);
|
||||
}
|
||||
} else if (version->serial == qpdb->least_serial) {
|
||||
INSIST(EMPTY(version->changed_list));
|
||||
INSIST(ISC_LIST_EMPTY(version->changed_list));
|
||||
}
|
||||
UNLINK(qpdb->open_versions, version, link);
|
||||
ISC_LIST_UNLINK(qpdb->open_versions, version, link);
|
||||
}
|
||||
least_serial = qpdb->least_serial;
|
||||
RWUNLOCK(&qpdb->lock, isc_rwlocktype_write);
|
||||
|
||||
if (cleanup_version != NULL) {
|
||||
isc_refcount_destroy(&cleanup_version->references);
|
||||
INSIST(EMPTY(cleanup_version->changed_list));
|
||||
INSIST(ISC_LIST_EMPTY(cleanup_version->changed_list));
|
||||
cleanup_gluelists(&cleanup_version->glue_stack);
|
||||
cds_wfs_destroy(&cleanup_version->glue_stack);
|
||||
isc_rwlock_destroy(&cleanup_version->rwlock);
|
||||
|
|
@ -1506,8 +1509,8 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
|||
/*
|
||||
* Commit/rollback re-signed headers.
|
||||
*/
|
||||
for (header = HEAD(resigned_list); header != NULL;
|
||||
header = HEAD(resigned_list))
|
||||
for (header = ISC_LIST_HEAD(resigned_list); header != NULL;
|
||||
header = ISC_LIST_HEAD(resigned_list))
|
||||
{
|
||||
isc_rwlock_t *nlock = NULL;
|
||||
isc_rwlocktype_t nlocktype = isc_rwlocktype_none;
|
||||
|
|
@ -1527,13 +1530,13 @@ closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
|||
dns_qp_t *tree = NULL, *nsec = NULL, *nsec3 = NULL;
|
||||
bool need_tree = false, need_nsec = false, need_nsec3 = false;
|
||||
|
||||
for (changed = HEAD(cleanup_list); changed != NULL;
|
||||
for (changed = ISC_LIST_HEAD(cleanup_list); changed != NULL;
|
||||
changed = next_changed)
|
||||
{
|
||||
isc_rwlock_t *nlock = NULL;
|
||||
isc_rwlocktype_t nlocktype = isc_rwlocktype_none;
|
||||
|
||||
next_changed = NEXT(changed, link);
|
||||
next_changed = ISC_LIST_NEXT(changed, link);
|
||||
node = changed->node;
|
||||
nlock = &qpdb->buckets[node->locknum].lock;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ libisc_la_HEADERS = \
|
|||
include/isc/base64.h \
|
||||
include/isc/buffer.h \
|
||||
include/isc/commandline.h \
|
||||
include/isc/condition.h \
|
||||
include/isc/counter.h \
|
||||
include/isc/crypto.h \
|
||||
include/isc/dir.h \
|
||||
|
|
@ -51,7 +50,6 @@ libisc_la_HEADERS = \
|
|||
include/isc/mem.h \
|
||||
include/isc/meminfo.h \
|
||||
include/isc/mutex.h \
|
||||
include/isc/mutexblock.h \
|
||||
include/isc/net.h \
|
||||
include/isc/netaddr.h \
|
||||
include/isc/netmgr.h \
|
||||
|
|
@ -122,7 +120,6 @@ libisc_la_SOURCES = \
|
|||
base32.c \
|
||||
base64.c \
|
||||
commandline.c \
|
||||
condition.c \
|
||||
counter.c \
|
||||
crypto.c \
|
||||
dir.c \
|
||||
|
|
@ -159,7 +156,6 @@ libisc_la_SOURCES = \
|
|||
meminfo.c \
|
||||
mutex.c \
|
||||
mutex_p.h \
|
||||
mutexblock.c \
|
||||
net.c \
|
||||
netaddr.c \
|
||||
netscope.c \
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#include <isc/async.h>
|
||||
#include <isc/atomic.h>
|
||||
#include <isc/barrier.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/job.h>
|
||||
#include <isc/loop.h>
|
||||
#include <isc/magic.h>
|
||||
|
|
|
|||
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* SPDX-License-Identifier: MPL-2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* See the COPYRIGHT file distributed with this work for additional
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <isc/condition.h>
|
||||
#include <isc/strerr.h>
|
||||
#include <isc/string.h>
|
||||
#include <isc/time.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
isc_result_t
|
||||
isc__condition_waituntil(pthread_cond_t *c, pthread_mutex_t *m, isc_time_t *t) {
|
||||
int presult;
|
||||
isc_result_t result;
|
||||
struct timespec ts;
|
||||
|
||||
REQUIRE(c != NULL && m != NULL && t != NULL);
|
||||
|
||||
/*
|
||||
* POSIX defines a timespec's tv_sec as time_t.
|
||||
*/
|
||||
result = isc_time_secondsastimet(t, &ts.tv_sec);
|
||||
|
||||
/*
|
||||
* If we have a range error ts.tv_sec is most probably a signed
|
||||
* 32 bit value. Set ts.tv_sec to INT_MAX. This is a kludge.
|
||||
*/
|
||||
if (result == ISC_R_RANGE) {
|
||||
ts.tv_sec = INT_MAX;
|
||||
} else if (result != ISC_R_SUCCESS) {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*!
|
||||
* POSIX defines a timespec's tv_nsec as long. isc_time_nanoseconds
|
||||
* ensures its return value is < 1 billion, which will fit in a long.
|
||||
*/
|
||||
ts.tv_nsec = (long)isc_time_nanoseconds(t);
|
||||
|
||||
do {
|
||||
presult = pthread_cond_timedwait(c, m, &ts);
|
||||
if (presult == 0) {
|
||||
return ISC_R_SUCCESS;
|
||||
}
|
||||
if (presult == ETIMEDOUT) {
|
||||
return ISC_R_TIMEDOUT;
|
||||
}
|
||||
} while (presult == EINTR);
|
||||
|
||||
UNEXPECTED_SYSERROR(presult, "pthread_cond_timedwait()");
|
||||
return ISC_R_UNEXPECTED;
|
||||
}
|
||||
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
#include <isc/atomic.h>
|
||||
#include <isc/barrier.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/helper.h>
|
||||
#include <isc/job.h>
|
||||
#include <isc/loop.h>
|
||||
|
|
|
|||
|
|
@ -1,97 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* SPDX-License-Identifier: MPL-2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* See the COPYRIGHT file distributed with this work for additional
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/error.h>
|
||||
#include <isc/mutex.h>
|
||||
#include <isc/result.h>
|
||||
#include <isc/string.h>
|
||||
#include <isc/types.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
/*
|
||||
* We use macros instead of static inline functions so that the exact code
|
||||
* location can be reported when PTHREADS_RUNTIME_CHECK() fails or when mutrace
|
||||
* reports lock contention.
|
||||
*/
|
||||
|
||||
#ifdef ISC_TRACK_PTHREADS_OBJECTS
|
||||
|
||||
typedef pthread_cond_t *isc_condition_t;
|
||||
|
||||
#define isc_condition_init(cp) \
|
||||
{ \
|
||||
*cp = malloc(sizeof(**cp)); \
|
||||
isc__condition_init(*cp); \
|
||||
}
|
||||
#define isc_condition_wait(cp, mp) isc__condition_wait(*cp, *mp)
|
||||
#define isc_condition_waituntil(cp, mp, t) isc__condition_waituntil(*cp, *mp, t)
|
||||
#define isc_condition_signal(cp) isc__condition_signal(*cp)
|
||||
#define isc_condition_broadcast(cp) isc__condition_broadcast(*cp)
|
||||
#define isc_condition_destroy(cp) \
|
||||
{ \
|
||||
isc__condition_destroy(*cp); \
|
||||
free(*cp); \
|
||||
}
|
||||
|
||||
#else /* ISC_TRACK_PTHREADS_OBJECTS */
|
||||
|
||||
typedef pthread_cond_t isc_condition_t;
|
||||
|
||||
#define isc_condition_init(cond) isc__condition_init(cond)
|
||||
#define isc_condition_wait(cp, mp) isc__condition_wait(cp, mp)
|
||||
#define isc_condition_waituntil(cp, mp, t) isc__condition_waituntil(cp, mp, t)
|
||||
#define isc_condition_signal(cp) isc__condition_signal(cp)
|
||||
#define isc_condition_broadcast(cp) isc__condition_broadcast(cp)
|
||||
#define isc_condition_destroy(cp) isc__condition_destroy(cp)
|
||||
|
||||
#endif /* ISC_TRACK_PTHREADS_OBJECTS */
|
||||
|
||||
#define isc__condition_init(cond) \
|
||||
{ \
|
||||
int _ret = pthread_cond_init(cond, NULL); \
|
||||
PTHREADS_RUNTIME_CHECK(pthread_cond_init, _ret); \
|
||||
}
|
||||
|
||||
#define isc__condition_wait(cp, mp) \
|
||||
{ \
|
||||
int _ret = pthread_cond_wait(cp, mp); \
|
||||
PTHREADS_RUNTIME_CHECK(pthread_cond_wait, _ret); \
|
||||
}
|
||||
|
||||
#define isc__condition_signal(cp) \
|
||||
{ \
|
||||
int _ret = pthread_cond_signal(cp); \
|
||||
PTHREADS_RUNTIME_CHECK(pthread_cond_signal, _ret); \
|
||||
}
|
||||
|
||||
#define isc__condition_broadcast(cp) \
|
||||
{ \
|
||||
int _ret = pthread_cond_broadcast(cp); \
|
||||
PTHREADS_RUNTIME_CHECK(pthread_cond_broadcast, _ret); \
|
||||
}
|
||||
|
||||
#define isc__condition_destroy(cp) \
|
||||
{ \
|
||||
int _ret = pthread_cond_destroy(cp); \
|
||||
PTHREADS_RUNTIME_CHECK(pthread_cond_destroy, _ret); \
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
isc__condition_waituntil(pthread_cond_t *, pthread_mutex_t *, isc_time_t *);
|
||||
|
|
@ -22,6 +22,21 @@
|
|||
#include <isc/result.h> /* for ISC_R_ codes */
|
||||
#include <isc/util.h>
|
||||
|
||||
#define LOCK(lp) \
|
||||
{ \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "LOCKING %p %s %d\n", (lp), \
|
||||
__FILE__, __LINE__)); \
|
||||
isc_mutex_lock((lp)); \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "LOCKED %p %s %d\n", (lp), \
|
||||
__FILE__, __LINE__)); \
|
||||
}
|
||||
#define UNLOCK(lp) \
|
||||
{ \
|
||||
isc_mutex_unlock((lp)); \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "UNLOCKED %p %s %d\n", (lp), \
|
||||
__FILE__, __LINE__)); \
|
||||
}
|
||||
|
||||
/*
|
||||
* We use macros instead of static inline functions so that the exact code
|
||||
* location can be reported when PTHREADS_RUNTIME_CHECK() fails or when mutrace
|
||||
|
|
|
|||
|
|
@ -1,49 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* SPDX-License-Identifier: MPL-2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* See the COPYRIGHT file distributed with this work for additional
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/*! \file isc/mutexblock.h */
|
||||
|
||||
#include <isc/mutex.h>
|
||||
#include <isc/types.h>
|
||||
|
||||
void
|
||||
isc_mutexblock_init(isc_mutex_t *block, unsigned int count);
|
||||
/*%<
|
||||
* Initialize a block of locks. If an error occurs all initialized locks
|
||||
* will be destroyed, if possible.
|
||||
*
|
||||
* Requires:
|
||||
*
|
||||
*\li block != NULL
|
||||
*
|
||||
*\li count > 0
|
||||
*
|
||||
*/
|
||||
|
||||
void
|
||||
isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count);
|
||||
/*%<
|
||||
* Destroy a block of locks.
|
||||
*
|
||||
* Requires:
|
||||
*
|
||||
*\li block != NULL
|
||||
*
|
||||
*\li count > 0
|
||||
*
|
||||
*\li Each lock in the block be initialized via isc_mutex_init() or
|
||||
* the whole block was initialized via isc_mutex_initblock().
|
||||
*
|
||||
*/
|
||||
|
|
@ -14,7 +14,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*! \file isc/rwlock.h */
|
||||
|
||||
|
|
@ -27,7 +26,42 @@ typedef enum {
|
|||
isc_rwlocktype_write
|
||||
} isc_rwlocktype_t;
|
||||
|
||||
#define RWLOCK(lp, t) \
|
||||
{ \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "RWLOCK %p, %d %s %d\n", (lp), \
|
||||
(t), __FILE__, __LINE__)); \
|
||||
isc_rwlock_lock((lp), (t)); \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "RWLOCKED %p, %d %s %d\n", \
|
||||
(lp), (t), __FILE__, __LINE__)); \
|
||||
}
|
||||
#define RWUNLOCK(lp, t) \
|
||||
{ \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "RWUNLOCK %p, %d %s %d\n", \
|
||||
(lp), (t), __FILE__, __LINE__)); \
|
||||
isc_rwlock_unlock((lp), (t)); \
|
||||
}
|
||||
|
||||
#define RDLOCK(lp) RWLOCK(lp, isc_rwlocktype_read)
|
||||
#define RDUNLOCK(lp) RWUNLOCK(lp, isc_rwlocktype_read)
|
||||
#define WRLOCK(lp) RWLOCK(lp, isc_rwlocktype_write)
|
||||
#define WRUNLOCK(lp) RWUNLOCK(lp, isc_rwlocktype_write)
|
||||
|
||||
#define UPGRADELOCK(lock, locktype) \
|
||||
{ \
|
||||
if (locktype == isc_rwlocktype_read) { \
|
||||
if (isc_rwlock_tryupgrade(lock) == ISC_R_SUCCESS) { \
|
||||
locktype = isc_rwlocktype_write; \
|
||||
} else { \
|
||||
RWUNLOCK(lock, locktype); \
|
||||
locktype = isc_rwlocktype_write; \
|
||||
RWLOCK(lock, locktype); \
|
||||
} \
|
||||
} \
|
||||
INSIST(locktype == isc_rwlocktype_write); \
|
||||
}
|
||||
|
||||
#if USE_PTHREAD_RWLOCK
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
|
||||
/*
|
||||
|
|
@ -38,6 +72,8 @@ typedef enum {
|
|||
|
||||
#if ISC_TRACK_PTHREADS_OBJECTS
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
typedef pthread_rwlock_t *isc_rwlock_t;
|
||||
typedef pthread_rwlock_t isc__rwlock_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,21 @@
|
|||
#include <isc/atomic.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#define SPINLOCK(sp) \
|
||||
{ \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "SPINLOCKING %p %s %d\n", (sp), \
|
||||
__FILE__, __LINE__)); \
|
||||
isc_spinlock_lock((sp)); \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "SPINLOCKED %p %s %d\n", (sp), \
|
||||
__FILE__, __LINE__)); \
|
||||
}
|
||||
#define SPINUNLOCK(sp) \
|
||||
{ \
|
||||
isc_spinlock_unlock((sp)); \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "SPINUNLOCKED %p %s %d\n", \
|
||||
(sp), __FILE__, __LINE__)); \
|
||||
}
|
||||
|
||||
/*
|
||||
* We use macros instead of static inline functions so that the exact code
|
||||
* location can be reported when PTHREADS_RUNTIME_CHECK() fails or when mutrace
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@
|
|||
* ISC_ or isc_ to the name.
|
||||
*/
|
||||
|
||||
#include <isc/attributes.h>
|
||||
|
||||
/***
|
||||
*** Clang Compatibility Macros
|
||||
***/
|
||||
|
|
@ -110,11 +108,6 @@
|
|||
*/
|
||||
#define EMPTY_TRANSLATION_UNIT extern int isc__empty;
|
||||
|
||||
/*%
|
||||
* We use macros instead of calling the routines directly because
|
||||
* the capital letters make the locking stand out.
|
||||
*/
|
||||
|
||||
#ifdef ISC_UTIL_TRACEON
|
||||
#define ISC_UTIL_TRACE(a) a
|
||||
#include <stdio.h> /* Required for fprintf/stderr when tracing. */
|
||||
|
|
@ -122,125 +115,6 @@
|
|||
#define ISC_UTIL_TRACE(a)
|
||||
#endif /* ifdef ISC_UTIL_TRACEON */
|
||||
|
||||
#include <isc/result.h> /* Contractual promise. */
|
||||
|
||||
#define SPINLOCK(sp) \
|
||||
{ \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "SPINLOCKING %p %s %d\n", (sp), \
|
||||
__FILE__, __LINE__)); \
|
||||
isc_spinlock_lock((sp)); \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "SPINLOCKED %p %s %d\n", (sp), \
|
||||
__FILE__, __LINE__)); \
|
||||
}
|
||||
#define SPINUNLOCK(sp) \
|
||||
{ \
|
||||
isc_spinlock_unlock((sp)); \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "SPINUNLOCKED %p %s %d\n", \
|
||||
(sp), __FILE__, __LINE__)); \
|
||||
}
|
||||
|
||||
#define LOCK(lp) \
|
||||
{ \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "LOCKING %p %s %d\n", (lp), \
|
||||
__FILE__, __LINE__)); \
|
||||
isc_mutex_lock((lp)); \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "LOCKED %p %s %d\n", (lp), \
|
||||
__FILE__, __LINE__)); \
|
||||
}
|
||||
#define UNLOCK(lp) \
|
||||
{ \
|
||||
isc_mutex_unlock((lp)); \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "UNLOCKED %p %s %d\n", (lp), \
|
||||
__FILE__, __LINE__)); \
|
||||
}
|
||||
|
||||
#define BROADCAST(cvp) \
|
||||
{ \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "BROADCAST %p %s %d\n", (cvp), \
|
||||
__FILE__, __LINE__)); \
|
||||
isc_condition_broadcast((cvp)); \
|
||||
}
|
||||
#define SIGNAL(cvp) \
|
||||
{ \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "SIGNAL %p %s %d\n", (cvp), \
|
||||
__FILE__, __LINE__)); \
|
||||
isc_condition_signal((cvp)); \
|
||||
}
|
||||
#define WAIT(cvp, lp) \
|
||||
{ \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "WAIT %p LOCK %p %s %d\n", \
|
||||
(cvp), (lp), __FILE__, __LINE__)); \
|
||||
isc_condition_wait((cvp), (lp)); \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "WAITED %p LOCKED %p %s %d\n", \
|
||||
(cvp), (lp), __FILE__, __LINE__)); \
|
||||
}
|
||||
|
||||
/*
|
||||
* isc_condition_waituntil can return ISC_R_TIMEDOUT, so we
|
||||
* don't RUNTIME_CHECK the result.
|
||||
*
|
||||
* XXX Also, can't really debug this then...
|
||||
*/
|
||||
|
||||
#define WAITUNTIL(cvp, lp, tp) isc_condition_waituntil((cvp), (lp), (tp))
|
||||
|
||||
#define RWLOCK(lp, t) \
|
||||
{ \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "RWLOCK %p, %d %s %d\n", (lp), \
|
||||
(t), __FILE__, __LINE__)); \
|
||||
isc_rwlock_lock((lp), (t)); \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "RWLOCKED %p, %d %s %d\n", \
|
||||
(lp), (t), __FILE__, __LINE__)); \
|
||||
}
|
||||
#define RWUNLOCK(lp, t) \
|
||||
{ \
|
||||
ISC_UTIL_TRACE(fprintf(stderr, "RWUNLOCK %p, %d %s %d\n", \
|
||||
(lp), (t), __FILE__, __LINE__)); \
|
||||
isc_rwlock_unlock((lp), (t)); \
|
||||
}
|
||||
|
||||
#define RDLOCK(lp) RWLOCK(lp, isc_rwlocktype_read)
|
||||
#define RDUNLOCK(lp) RWUNLOCK(lp, isc_rwlocktype_read)
|
||||
#define WRLOCK(lp) RWLOCK(lp, isc_rwlocktype_write)
|
||||
#define WRUNLOCK(lp) RWUNLOCK(lp, isc_rwlocktype_write)
|
||||
|
||||
#define UPGRADELOCK(lock, locktype) \
|
||||
{ \
|
||||
if (locktype == isc_rwlocktype_read) { \
|
||||
if (isc_rwlock_tryupgrade(lock) == ISC_R_SUCCESS) { \
|
||||
locktype = isc_rwlocktype_write; \
|
||||
} else { \
|
||||
RWUNLOCK(lock, locktype); \
|
||||
locktype = isc_rwlocktype_write; \
|
||||
RWLOCK(lock, locktype); \
|
||||
} \
|
||||
} \
|
||||
INSIST(locktype == isc_rwlocktype_write); \
|
||||
}
|
||||
|
||||
/*
|
||||
* List Macros.
|
||||
*/
|
||||
#include <isc/list.h> /* Contractual promise. */
|
||||
|
||||
#define LIST(type) ISC_LIST(type)
|
||||
#define INIT_LIST(type) ISC_LIST_INIT(type)
|
||||
#define LINK(type) ISC_LINK(type)
|
||||
#define INIT_LINK(elt, link) ISC_LINK_INIT(elt, link)
|
||||
#define HEAD(list) ISC_LIST_HEAD(list)
|
||||
#define TAIL(list) ISC_LIST_TAIL(list)
|
||||
#define EMPTY(list) ISC_LIST_EMPTY(list)
|
||||
#define PREV(elt, link) ISC_LIST_PREV(elt, link)
|
||||
#define NEXT(elt, link) ISC_LIST_NEXT(elt, link)
|
||||
#define APPEND(list, elt, link) ISC_LIST_APPEND(list, elt, link)
|
||||
#define PREPEND(list, elt, link) ISC_LIST_PREPEND(list, elt, link)
|
||||
#define UNLINK(list, elt, link) ISC_LIST_UNLINK(list, elt, link)
|
||||
#define ENQUEUE(list, elt, link) ISC_LIST_APPEND(list, elt, link)
|
||||
#define DEQUEUE(list, elt, link) ISC_LIST_UNLINK(list, elt, link)
|
||||
#define INSERTBEFORE(li, b, e, ln) ISC_LIST_INSERTBEFORE(li, b, e, ln)
|
||||
#define INSERTAFTER(li, a, e, ln) ISC_LIST_INSERTAFTER(li, a, e, ln)
|
||||
#define APPENDLIST(list1, list2, link) ISC_LIST_APPENDLIST(list1, list2, link)
|
||||
|
||||
/*%
|
||||
* Performance
|
||||
*/
|
||||
|
|
@ -266,18 +140,7 @@
|
|||
#define ISC_NO_SANITIZE_THREAD
|
||||
#endif /* if __SANITIZE_THREAD__ */
|
||||
|
||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR >= 6)
|
||||
#define STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
|
||||
#elif __has_feature(c_static_assert)
|
||||
#define STATIC_ASSERT(cond, msg) _Static_assert(cond, msg)
|
||||
#else /* if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR >= 6) */
|
||||
|
||||
/* Courtesy of Joseph Quinsey: https://godbolt.org/z/K9RvWS */
|
||||
#define TOKENPASTE(a, b) a##b /* "##" is the "Token Pasting Operator" */
|
||||
#define EXPAND_THEN_PASTE(a, b) TOKENPASTE(a, b) /* expand then paste */
|
||||
#define STATIC_ASSERT(x, msg) \
|
||||
enum { EXPAND_THEN_PASTE(ASSERT_line_, __LINE__) = 1 / ((msg) && (x)) }
|
||||
#endif /* if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR >= 6) */
|
||||
|
||||
#ifdef UNIT_TESTING
|
||||
extern void
|
||||
|
|
@ -336,8 +199,6 @@ mock_assert(const int result, const char *const expression,
|
|||
/*
|
||||
* Errors
|
||||
*/
|
||||
#include <errno.h> /* for errno */
|
||||
|
||||
#include <isc/error.h> /* Contractual promise. */
|
||||
#include <isc/strerr.h> /* for ISC_STRERRORSIZE */
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
#include <isc/atomic.h>
|
||||
#include <isc/barrier.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/job.h>
|
||||
#include <isc/list.h>
|
||||
#include <isc/loop.h>
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ struct isc_lex {
|
|||
unsigned int paren_count;
|
||||
unsigned int saved_paren_count;
|
||||
isc_lexspecials_t specials;
|
||||
LIST(struct inputsource) sources;
|
||||
ISC_LIST(struct inputsource) sources;
|
||||
};
|
||||
|
||||
static void
|
||||
|
|
@ -104,7 +104,7 @@ isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp) {
|
|||
lex->paren_count = 0;
|
||||
lex->saved_paren_count = 0;
|
||||
memset(lex->specials, 0, 256);
|
||||
INIT_LIST(lex->sources);
|
||||
ISC_LIST_INIT(lex->sources);
|
||||
lex->magic = LEX_MAGIC;
|
||||
|
||||
*lexp = lex;
|
||||
|
|
@ -123,7 +123,7 @@ isc_lex_destroy(isc_lex_t **lexp) {
|
|||
*lexp = NULL;
|
||||
REQUIRE(VALID_LEX(lex));
|
||||
|
||||
while (!EMPTY(lex->sources)) {
|
||||
while (!ISC_LIST_EMPTY(lex->sources)) {
|
||||
RUNTIME_CHECK(isc_lex_close(lex) == ISC_R_SUCCESS);
|
||||
}
|
||||
if (lex->data != NULL) {
|
||||
|
|
@ -259,7 +259,7 @@ isc_lex_close(isc_lex_t *lex) {
|
|||
|
||||
REQUIRE(VALID_LEX(lex));
|
||||
|
||||
source = HEAD(lex->sources);
|
||||
source = ISC_LIST_HEAD(lex->sources);
|
||||
if (source == NULL) {
|
||||
return ISC_R_NOMORE;
|
||||
}
|
||||
|
|
@ -352,7 +352,7 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
|
|||
*/
|
||||
|
||||
REQUIRE(VALID_LEX(lex));
|
||||
source = HEAD(lex->sources);
|
||||
source = ISC_LIST_HEAD(lex->sources);
|
||||
REQUIRE(tokenp != NULL);
|
||||
|
||||
if (source == NULL) {
|
||||
|
|
@ -999,7 +999,7 @@ isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp) {
|
|||
*/
|
||||
|
||||
REQUIRE(VALID_LEX(lex));
|
||||
source = HEAD(lex->sources);
|
||||
source = ISC_LIST_HEAD(lex->sources);
|
||||
REQUIRE(source != NULL);
|
||||
REQUIRE(tokenp != NULL);
|
||||
REQUIRE(isc_buffer_consumedlength(source->pushback) != 0 ||
|
||||
|
|
@ -1018,7 +1018,7 @@ isc_lex_getlasttokentext(isc_lex_t *lex, isc_token_t *tokenp, isc_region_t *r) {
|
|||
inputsource *source;
|
||||
|
||||
REQUIRE(VALID_LEX(lex));
|
||||
source = HEAD(lex->sources);
|
||||
source = ISC_LIST_HEAD(lex->sources);
|
||||
REQUIRE(source != NULL);
|
||||
REQUIRE(tokenp != NULL);
|
||||
REQUIRE(isc_buffer_consumedlength(source->pushback) != 0 ||
|
||||
|
|
@ -1038,7 +1038,7 @@ isc_lex_getsourcename(isc_lex_t *lex) {
|
|||
inputsource *source;
|
||||
|
||||
REQUIRE(VALID_LEX(lex));
|
||||
source = HEAD(lex->sources);
|
||||
source = ISC_LIST_HEAD(lex->sources);
|
||||
|
||||
if (source == NULL) {
|
||||
return NULL;
|
||||
|
|
@ -1052,7 +1052,7 @@ isc_lex_getsourceline(isc_lex_t *lex) {
|
|||
inputsource *source;
|
||||
|
||||
REQUIRE(VALID_LEX(lex));
|
||||
source = HEAD(lex->sources);
|
||||
source = ISC_LIST_HEAD(lex->sources);
|
||||
|
||||
if (source == NULL) {
|
||||
return 0;
|
||||
|
|
@ -1067,7 +1067,7 @@ isc_lex_setsourcename(isc_lex_t *lex, const char *name) {
|
|||
char *newname;
|
||||
|
||||
REQUIRE(VALID_LEX(lex));
|
||||
source = HEAD(lex->sources);
|
||||
source = ISC_LIST_HEAD(lex->sources);
|
||||
|
||||
if (source == NULL) {
|
||||
return ISC_R_NOTFOUND;
|
||||
|
|
@ -1083,7 +1083,7 @@ isc_lex_setsourceline(isc_lex_t *lex, unsigned long line) {
|
|||
inputsource *source;
|
||||
|
||||
REQUIRE(VALID_LEX(lex));
|
||||
source = HEAD(lex->sources);
|
||||
source = ISC_LIST_HEAD(lex->sources);
|
||||
|
||||
if (source == NULL) {
|
||||
return ISC_R_NOTFOUND;
|
||||
|
|
@ -1099,7 +1099,7 @@ isc_lex_isfile(isc_lex_t *lex) {
|
|||
|
||||
REQUIRE(VALID_LEX(lex));
|
||||
|
||||
source = HEAD(lex->sources);
|
||||
source = ISC_LIST_HEAD(lex->sources);
|
||||
|
||||
if (source == NULL) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#include <isc/async.h>
|
||||
#include <isc/atomic.h>
|
||||
#include <isc/barrier.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/job.h>
|
||||
#include <isc/list.h>
|
||||
#include <isc/log.h>
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* SPDX-License-Identifier: MPL-2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* See the COPYRIGHT file distributed with this work for additional
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <isc/mutexblock.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
isc_mutexblock_destroy(isc_mutex_t *block, unsigned int count) {
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
isc_mutex_destroy(&block[i]);
|
||||
}
|
||||
}
|
||||
|
|
@ -150,7 +150,7 @@ typedef struct http_cstream {
|
|||
|
||||
isc_nm_http_response_status_t response_status;
|
||||
isc_nmsocket_t *httpsock;
|
||||
LINK(struct http_cstream) link;
|
||||
ISC_LINK(struct http_cstream) link;
|
||||
} http_cstream_t;
|
||||
|
||||
#define HTTP2_SESSION_MAGIC ISC_MAGIC('H', '2', 'S', 'S')
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
#include <isc/atomic.h>
|
||||
#include <isc/barrier.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/dnsstream.h>
|
||||
#include <isc/magic.h>
|
||||
#include <isc/mem.h>
|
||||
|
|
@ -271,8 +270,8 @@ struct isc_nmhandle {
|
|||
void *backtrace[TRACE_SIZE];
|
||||
int backtrace_size;
|
||||
#endif
|
||||
LINK(isc_nmhandle_t) active_link;
|
||||
LINK(isc_nmhandle_t) inactive_link;
|
||||
ISC_LINK(isc_nmhandle_t) active_link;
|
||||
ISC_LINK(isc_nmhandle_t) inactive_link;
|
||||
|
||||
void *opaque;
|
||||
|
||||
|
|
@ -423,7 +422,7 @@ typedef struct isc_nm_httphandler {
|
|||
char *path;
|
||||
isc_nm_recv_cb_t cb;
|
||||
void *cbarg;
|
||||
LINK(struct isc_nm_httphandler) link;
|
||||
ISC_LINK(struct isc_nm_httphandler) link;
|
||||
} isc_nm_httphandler_t;
|
||||
|
||||
struct isc_nm_http_endpoints {
|
||||
|
|
@ -467,7 +466,7 @@ typedef struct isc_nmsocket_h2 {
|
|||
|
||||
isc_nm_recv_cb_t cb;
|
||||
void *cbarg;
|
||||
LINK(struct isc_nmsocket_h2) link;
|
||||
ISC_LINK(struct isc_nmsocket_h2) link;
|
||||
|
||||
isc_nm_http_endpoints_t **listener_endpoints;
|
||||
size_t n_listener_endpoints;
|
||||
|
|
@ -713,7 +712,7 @@ struct isc_nmsocket {
|
|||
void *backtrace[TRACE_SIZE];
|
||||
int backtrace_size;
|
||||
#endif
|
||||
LINK(isc_nmsocket_t) active_link;
|
||||
ISC_LINK(isc_nmsocket_t) active_link;
|
||||
|
||||
isc_job_t job;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
#include <isc/backtrace.h>
|
||||
#include <isc/barrier.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/errno.h>
|
||||
#include <isc/job.h>
|
||||
#include <isc/list.h>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#include <isc/atomic.h>
|
||||
#include <isc/barrier.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/errno.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/magic.h>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
#include <isc/async.h>
|
||||
#include <isc/atomic.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/magic.h>
|
||||
#include <isc/mem.h>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
#include <isc/atomic.h>
|
||||
#include <isc/barrier.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/errno.h>
|
||||
#include <isc/magic.h>
|
||||
#include <isc/mem.h>
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ isc__ratelimiter_tick(void *arg) {
|
|||
REQUIRE(rl->timer != NULL);
|
||||
|
||||
if (rl->state == isc_ratelimiter_shuttingdown) {
|
||||
INSIST(EMPTY(rl->pending));
|
||||
INSIST(ISC_LIST_EMPTY(rl->pending));
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
|
|
@ -277,7 +277,7 @@ isc__ratelimiter_doshutdown(void *arg) {
|
|||
|
||||
LOCK(&rl->lock);
|
||||
INSIST(rl->state == isc_ratelimiter_shuttingdown);
|
||||
INSIST(EMPTY(rl->pending));
|
||||
INSIST(ISC_LIST_EMPTY(rl->pending));
|
||||
|
||||
isc_timer_stop(rl->timer);
|
||||
isc_timer_destroy(&rl->timer);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
#include <isc/async.h>
|
||||
#include <isc/atomic.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/heap.h>
|
||||
#include <isc/job.h>
|
||||
#include <isc/log.h>
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@
|
|||
#include <isc/magic.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/mutex.h>
|
||||
#include <isc/mutexblock.h>
|
||||
#include <isc/once.h>
|
||||
#include <isc/random.h>
|
||||
#include <isc/refcount.h>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ struct ns_plugin {
|
|||
ns_plugin_check_t *check_func;
|
||||
ns_plugin_register_t *register_func;
|
||||
ns_plugin_destroy_t *destroy_func;
|
||||
LINK(ns_plugin_t) link;
|
||||
ISC_LINK(ns_plugin_t) link;
|
||||
};
|
||||
|
||||
static ns_hooklist_t default_hooktable[NS_HOOKPOINTS_COUNT];
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include <isc/async.h>
|
||||
#include <isc/atomic.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/mutex.h>
|
||||
#include <isc/netmgr.h>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include <isc/atomic.h>
|
||||
#include <isc/commandline.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/job.h>
|
||||
#include <isc/lib.h>
|
||||
#include <isc/loop.h>
|
||||
|
|
|
|||
Loading…
Reference in a new issue