mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-10 13:49:58 -04:00
Merge branch 'marka-missing-initialisations' into 'main'
Add missing initialisations See merge request isc-projects/bind9!5097
This commit is contained in:
commit
d3a8aa4daa
10 changed files with 47 additions and 7 deletions
|
|
@ -1466,6 +1466,7 @@ named_controls_create(named_server_t *server, named_controls_t **ctrlsp) {
|
|||
|
||||
ISC_LIST_INIT(controls->listeners);
|
||||
|
||||
atomic_init(&controls->shuttingdown, false);
|
||||
isc_mutex_init(&controls->symtab_lock);
|
||||
LOCK(&controls->symtab_lock);
|
||||
result = isccc_cc_createsymtab(&controls->symtab);
|
||||
|
|
|
|||
|
|
@ -766,7 +766,7 @@ static char FILE_VERSION[32] = "\0";
|
|||
* that indicates that the database does not implement cyclic
|
||||
* processing.
|
||||
*/
|
||||
static atomic_uint_fast32_t init_count;
|
||||
static atomic_uint_fast32_t init_count = ATOMIC_VAR_INIT(0);
|
||||
|
||||
/*
|
||||
* Locking
|
||||
|
|
|
|||
|
|
@ -879,6 +879,12 @@ xfrin_create(isc_mem_t *mctx, dns_zone_t *zone, dns_db_t *db, isc_nm_t *netmgr,
|
|||
dns_zone_iattach(zone, &xfr->zone);
|
||||
dns_name_init(&xfr->name, NULL);
|
||||
|
||||
isc_refcount_init(&xfr->connects, 0);
|
||||
isc_refcount_init(&xfr->sends, 0);
|
||||
isc_refcount_init(&xfr->recvs, 0);
|
||||
|
||||
atomic_init(&xfr->shuttingdown, false);
|
||||
|
||||
if (db != NULL) {
|
||||
dns_db_attach(db, &xfr->db);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18132,6 +18132,9 @@ dns_zonemgr_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
|
|||
ISC_LIST_INIT(zmgr->waiting_for_xfrin);
|
||||
ISC_LIST_INIT(zmgr->xfrin_in_progress);
|
||||
memset(zmgr->unreachable, 0, sizeof(zmgr->unreachable));
|
||||
for (size_t i = 0; i < UNREACH_CACHE_SIZE; i++) {
|
||||
atomic_init(&zmgr->unreachable[i].expire, 0);
|
||||
}
|
||||
isc_rwlock_init(&zmgr->rwlock, 0, 0);
|
||||
|
||||
zmgr->transfersin = 10;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
*/
|
||||
|
||||
static isc_thread_t blockedthread;
|
||||
static atomic_bool is_running;
|
||||
static atomic_bool is_running = ATOMIC_VAR_INIT(0);
|
||||
|
||||
#ifdef WIN32
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -491,7 +491,15 @@ mem_create(isc_mem_t **ctxp, unsigned int flags) {
|
|||
atomic_init(&ctx->maxinuse, 0);
|
||||
atomic_init(&ctx->malloced, sizeof(*ctx));
|
||||
atomic_init(&ctx->maxmalloced, sizeof(*ctx));
|
||||
atomic_init(&ctx->hi_water, 0);
|
||||
atomic_init(&ctx->lo_water, 0);
|
||||
atomic_init(&ctx->hi_called, false);
|
||||
atomic_init(&ctx->is_overmem, false);
|
||||
|
||||
for (size_t i = 0; i < STATS_BUCKETS + 1; i++) {
|
||||
atomic_init(&ctx->stats[i].gets, 0);
|
||||
atomic_init(&ctx->stats[i].totalgets, 0);
|
||||
}
|
||||
ISC_LIST_INIT(ctx->pools);
|
||||
|
||||
#if ISC_MEM_TRACKLINES
|
||||
|
|
@ -1211,6 +1219,7 @@ isc_mempool_create(isc_mem_t *mctx, size_t size, isc_mempool_t **mpctxp) {
|
|||
atomic_init(&mpctx->freecount, 0);
|
||||
atomic_init(&mpctx->freemax, 1);
|
||||
atomic_init(&mpctx->fillcount, 1);
|
||||
atomic_init(&mpctx->gets, 0);
|
||||
|
||||
*mpctxp = (isc_mempool_t *)mpctx;
|
||||
|
||||
|
|
|
|||
|
|
@ -278,6 +278,14 @@ isc__netmgr_create(isc_mem_t *mctx, uint32_t workers, isc_nm_t **netmgrp) {
|
|||
atomic_init(&mgr->maxudp, 0);
|
||||
atomic_init(&mgr->interlocked, ISC_NETMGR_NON_INTERLOCKED);
|
||||
atomic_init(&mgr->workers_paused, 0);
|
||||
atomic_init(&mgr->paused, false);
|
||||
atomic_init(&mgr->closing, false);
|
||||
atomic_init(&mgr->idle, false);
|
||||
atomic_init(&mgr->keepalive, false);
|
||||
atomic_init(&mgr->recv_tcp_buffer_size, 0);
|
||||
atomic_init(&mgr->send_tcp_buffer_size, 0);
|
||||
atomic_init(&mgr->recv_udp_buffer_size, 0);
|
||||
atomic_init(&mgr->send_udp_buffer_size, 0);
|
||||
|
||||
#ifdef NETMGR_TRACE
|
||||
ISC_LIST_INIT(mgr->active_sockets);
|
||||
|
|
@ -1554,8 +1562,16 @@ isc___nmsocket_init(isc_nmsocket_t *sock, isc_nm_t *mgr, isc_nmsocket_type type,
|
|||
atomic_init(&sock->sequential, false);
|
||||
atomic_init(&sock->readpaused, false);
|
||||
atomic_init(&sock->closing, false);
|
||||
atomic_init(&sock->listening, 0);
|
||||
atomic_init(&sock->closed, 0);
|
||||
atomic_init(&sock->destroying, 0);
|
||||
atomic_init(&sock->ah, 0);
|
||||
atomic_init(&sock->client, 0);
|
||||
atomic_init(&sock->connecting, false);
|
||||
atomic_init(&sock->keepalive, false);
|
||||
atomic_init(&sock->connected, false);
|
||||
|
||||
atomic_store(&sock->active_child_connections, 0);
|
||||
atomic_init(&sock->active_child_connections, 0);
|
||||
|
||||
isc__nm_http_initsocket(sock);
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,9 @@ create_stats(isc_mem_t *mctx, int ncounters, isc_stats_t **statsp) {
|
|||
counters_alloc_size = sizeof(isc__atomic_statcounter_t) * ncounters;
|
||||
stats->counters = isc_mem_get(mctx, counters_alloc_size);
|
||||
isc_refcount_init(&stats->references, 1);
|
||||
memset(stats->counters, 0, counters_alloc_size);
|
||||
for (int i = 0; i < ncounters; i++) {
|
||||
atomic_init(&stats->counters[i], 0);
|
||||
}
|
||||
stats->mctx = NULL;
|
||||
isc_mem_attach(mctx, &stats->mctx);
|
||||
stats->ncounters = ncounters;
|
||||
|
|
|
|||
|
|
@ -960,7 +960,8 @@ isc__taskmgr_create(isc_mem_t *mctx, unsigned int default_quantum, isc_nm_t *nm,
|
|||
INIT_LIST(manager->tasks);
|
||||
atomic_init(&manager->exiting, false);
|
||||
atomic_init(&manager->mode, isc_taskmgrmode_normal);
|
||||
atomic_store_relaxed(&manager->exclusive_req, false);
|
||||
atomic_init(&manager->exclusive_req, false);
|
||||
atomic_init(&manager->tasks_count, 0);
|
||||
|
||||
isc_mem_attach(mctx, &manager->mctx);
|
||||
|
||||
|
|
|
|||
|
|
@ -114,9 +114,11 @@
|
|||
#endif /* ifndef NS_CLIENT_DROPPORT */
|
||||
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
LIBNS_EXTERNAL_DATA atomic_uint_fast32_t ns_client_requests;
|
||||
LIBNS_EXTERNAL_DATA atomic_uint_fast32_t ns_client_requests =
|
||||
ATOMIC_VAR_INIT(0);
|
||||
#else /* if defined(_WIN32) && !defined(_WIN64) */
|
||||
LIBNS_EXTERNAL_DATA atomic_uint_fast64_t ns_client_requests;
|
||||
LIBNS_EXTERNAL_DATA atomic_uint_fast64_t ns_client_requests =
|
||||
ATOMIC_VAR_INIT(0);
|
||||
#endif /* if defined(_WIN32) && !defined(_WIN64) */
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Reference in a new issue