summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/knotd/main.c4
-rw-r--r--src/utils/kxdpgun/main.c8
2 files changed, 8 insertions, 4 deletions
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);
}
diff --git a/src/utils/kxdpgun/main.c b/src/utils/kxdpgun/main.c
index 3c036034a..8698adbcd 100644
--- a/src/utils/kxdpgun/main.c
+++ b/src/utils/kxdpgun/main.c
@@ -58,8 +58,8 @@
volatile int xdp_trigger = KXDPGUN_WAIT;
-volatile knot_atomic_uint64_t stats_trigger = 0;
-volatile knot_atomic_bool stats_switch = STATS_SUM;
+knot_atomic_uint64_t stats_trigger;
+knot_atomic_bool stats_switch;
unsigned global_cpu_aff_start = 0;
unsigned global_cpu_aff_step = 1;
@@ -1349,6 +1349,8 @@ static bool get_opts(int argc, char *argv[], xdp_gun_ctx_t *ctx)
int main(int argc, char *argv[])
{
int ecode = EXIT_FAILURE;
+ ATOMIC_INIT(stats_trigger, 0);
+ ATOMIC_INIT(stats_switch, STATS_SUM);
xdp_gun_ctx_t ctx = ctx_defaults, *thread_ctxs = NULL;
ctx.msgid = time(NULL) % UINT16_MAX;
@@ -1425,6 +1427,8 @@ int main(int argc, char *argv[])
ecode = EXIT_SUCCESS;
err:
+ ATOMIC_DEINIT(stats_trigger);
+ ATOMIC_DEINIT(stats_switch);
free(ctx.rss_conf);
free(thread_ctxs);
free(threads);