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

Synchronise stop listening operation for multi-layer transports

This commit introduces a primitive isc__nmsocket_stop() which performs
shutting down on a multilayered socket ensuring the proper order of
the operations.

The shared data within the socket object can be destroyed after the
call completed, as it is guaranteed to not be used from within the
context of other worker threads.
This commit is contained in:
Artem Boldariev
2022-10-14 20:45:40 +03:00
parent 55a184c13f
commit 5ab2c0ebb3
8 changed files with 114 additions and 32 deletions

View File

@@ -155,7 +155,7 @@ isc_nm_listenudp(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
sock->children = isc_mem_getx(worker->mctx, children_size,
ISC_MEM_ZERO);
isc_barrier_init(&sock->barrier, sock->nchildren);
isc__nmsocket_barrier_init(sock);
sock->recv_cb = cb;
sock->recv_cbarg = cbarg;