struct named_controls {
named_server_t *server;
controllistenerlist_t listeners;
- bool shuttingdown;
+ atomic_bool shuttingdown;
isc_mutex_t symtab_lock;
isccc_symtab_t *symtab;
};
conn->sending = false;
- if (listener->controls->shuttingdown || result == ISC_R_CANCELED) {
+ if (atomic_load_acquire(&listener->controls->shuttingdown) ||
+ result == ISC_R_CANCELED)
+ {
goto cleanup_sendhandle;
} else if (result != ISC_R_SUCCESS) {
char socktext[ISC_SOCKADDR_FORMATSIZE];
UNUSED(task);
- if (listener->controls->shuttingdown) {
+ if (atomic_load_acquire(&listener->controls->shuttingdown)) {
conn_cleanup(conn);
isc_nmhandle_detach(&conn->cmdhandle);
goto done;
conn->reading = false;
/* Is the server shutting down? */
- if (listener->controls->shuttingdown) {
+ if (atomic_load_acquire(&listener->controls->shuttingdown)) {
goto cleanup_readhandle;
}
if (result != ISC_R_SUCCESS) {
if (result == ISC_R_CANCELED) {
- listener->controls->shuttingdown = true;
+ atomic_store_release(&listener->controls->shuttingdown,
+ true);
} else if (result != ISC_R_EOF) {
log_invalid(&conn->ccmsg, result);
}
void
named_controls_shutdown(named_controls_t *controls) {
controls_shutdown(controls);
- controls->shuttingdown = true;
+ atomic_store_release(&controls->shuttingdown, true);
}
static isc_result_t