2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-27 20:49:04 +00:00
bind/lib/isc/managers.c
Evan Hunt a52b17d39b
remove isc_task completely
as there is no further use of isc_task in BIND, this commit removes
it, along with isc_taskmgr, isc_event, and all other related types.

functions that accepted taskmgr as a parameter have been cleaned up.
as a result of this change, some functions can no longer fail, so
they've been changed to type void, and their callers have been
updated accordingly.

the tasks table has been removed from the statistics channel and
the stats version has been updated. dns_dyndbctx has been changed
to reference the loopmgr instead of taskmgr, and DNS_DYNDB_VERSION
has been udpated as well.
2023-02-16 18:35:32 +01:00

52 lines
1.4 KiB
C

/*
* 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.
*/
#include <isc/managers.h>
#include <isc/rwlock.h>
#include <isc/util.h>
#include <isc/uv.h>
void
isc_managers_create(isc_mem_t **mctxp, uint32_t workers,
isc_loopmgr_t **loopmgrp, isc_nm_t **netmgrp) {
REQUIRE(mctxp != NULL && *mctxp == NULL);
isc_mem_create(mctxp);
INSIST(*mctxp != NULL);
REQUIRE(loopmgrp != NULL && *loopmgrp == NULL);
isc_loopmgr_create(*mctxp, workers, loopmgrp);
INSIST(*loopmgrp != NULL);
REQUIRE(netmgrp != NULL && *netmgrp == NULL);
isc_netmgr_create(*mctxp, *loopmgrp, netmgrp);
INSIST(*netmgrp != NULL);
isc_rwlock_setworkers(workers);
}
void
isc_managers_destroy(isc_mem_t **mctxp, isc_loopmgr_t **loopmgrp,
isc_nm_t **netmgrp) {
REQUIRE(mctxp != NULL && *mctxp != NULL);
REQUIRE(loopmgrp != NULL && *loopmgrp != NULL);
REQUIRE(netmgrp != NULL && *netmgrp != NULL);
/*
* The sequence of operations here is important:
*/
isc_netmgr_destroy(netmgrp);
isc_loopmgr_destroy(loopmgrp);
isc_mem_destroy(mctxp);
}