diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/knot/catalog/catalog_update.c | 2 | ||||
-rw-r--r-- | src/knot/server/server.c | 2 | ||||
-rw-r--r-- | src/knot/updates/zone-update.c | 2 | ||||
-rw-r--r-- | src/utils/knotd/main.c | 4 |
4 files changed, 6 insertions, 4 deletions
diff --git a/src/knot/catalog/catalog_update.c b/src/knot/catalog/catalog_update.c index 71b7dbe0f..a4470225b 100644 --- a/src/knot/catalog/catalog_update.c +++ b/src/knot/catalog/catalog_update.c @@ -405,7 +405,7 @@ int catalog_zone_purge(server_t *server, conf_t *conf, const knot_dname_t *zone) int ret = catalog_update_del_all(&server->catalog_upd, &server->catalog, zone, &members); if (ret == KNOT_EOK && members > 0) { log_zone_info(zone, "catalog zone purged, %zd member zones deconfigured", members); - server->catalog_upd_signal = true; + ATOMIC_SET(server->catalog_upd_signal, true); if (kill(getpid(), SIGUSR1) != 0) { ret = knot_map_errno(); } diff --git a/src/knot/server/server.c b/src/knot/server/server.c index 627ebd281..40c873fbd 100644 --- a/src/knot/server/server.c +++ b/src/knot/server/server.c @@ -849,6 +849,7 @@ int server_init(server_t *server, int bg_workers) evsched_deinit(&server->sched); return ret; } + ATOMIC_INIT(server->catalog_upd_signal, false); pthread_rwlock_init(&server->ctl_lock, NULL); @@ -913,6 +914,7 @@ void server_deinit(server_t *server) catalog_update_clear(&server->catalog_upd); catalog_update_deinit(&server->catalog_upd); catalog_deinit(&server->catalog); + ATOMIC_DEINIT(server->catalog_upd_signal); /* Close persistent timers DB. */ knot_lmdb_deinit(&server->timerdb); diff --git a/src/knot/updates/zone-update.c b/src/knot/updates/zone-update.c index 45c874ebc..0de40d53b 100644 --- a/src/knot/updates/zone-update.c +++ b/src/knot/updates/zone-update.c @@ -773,7 +773,7 @@ static int update_catalog(conf_t *conf, zone_update_t *update) if (ret == KNOT_EOK) { log_zone_info(update->zone->name, "enqueued %zd catalog updates", upd_count); - update->zone->server->catalog_upd_signal = true; + ATOMIC_SET(update->zone->server->catalog_upd_signal, true); if (kill(getpid(), SIGUSR1) != 0) { ret = knot_map_errno(); } diff --git a/src/utils/knotd/main.c b/src/utils/knotd/main.c index 55ac0f419..e96377b33 100644 --- a/src/utils/knotd/main.c +++ b/src/utils/knotd/main.c @@ -488,9 +488,9 @@ static void event_loop(server_t *server, const char *socket, bool daemonize, } if (sig_req_zones_reload && !sig_req_stop) { sig_req_zones_reload = false; - reload_t mode = server->catalog_upd_signal ? RELOAD_CATALOG : RELOAD_ZONES; + reload_t mode = ATOMIC_GET(server->catalog_upd_signal) ? RELOAD_CATALOG : RELOAD_ZONES; pthread_rwlock_wrlock(&server->ctl_lock); - server->catalog_upd_signal = false; + ATOMIC_SET(server->catalog_upd_signal, false); server_update_zones(conf(), server, mode); pthread_rwlock_unlock(&server->ctl_lock); } |