From f38b5a84a8c8a084d7549845b27fcd181c76c447 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 30 Mar 2025 18:51:47 +0200 Subject: [PATCH] Use fetch_add because the wait is before the operation --- cmdline/bw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdline/bw.c b/cmdline/bw.c index e5b59308..3c8c5b2f 100644 --- a/cmdline/bw.c +++ b/cmdline/bw.c @@ -35,7 +35,7 @@ void bw_limit(struct snapraid_bw* bw, uint64_t bytes) uint64_t done; uint64_t eta; - done = __atomic_add_fetch(&bw->total, bytes, __ATOMIC_SEQ_CST); + done = __atomic_fetch_add(&bw->total, bytes, __ATOMIC_SEQ_CST); eta = done * 1000 / bw->limit;