2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Get rid of locking during UDP and TCP listen

We already have a synchronization mechanism when starting the UDP and
TCP listener children - barriers.  Change how we start the first-born
child (tid == 0), so we don't have to race for sock->parent->result and
sock->parent->fd.
This commit is contained in:
Ondřej Surý
2023-01-04 12:21:00 +01:00
parent 7900cbd9a9
commit d06602f036
3 changed files with 48 additions and 72 deletions

View File

@@ -663,8 +663,6 @@ nmsocket_cleanup(isc_nmsocket_t *sock) {
sock->magic = 0;
isc_mutex_destroy(&sock->lock);
/* Don't free child socket */
if (sock->parent == NULL) {
REQUIRE(sock->tid == isc_tid());
@@ -858,8 +856,6 @@ isc___nmsocket_init(isc_nmsocket_t *sock, isc__networker_t *worker,
.active_link = ISC_LINK_INITIALIZER,
};
isc_mutex_init(&sock->lock);
if (iface != NULL) {
family = iface->type.sa.sa_family;
sock->iface = *iface;