Skip to content

Commit f38b5a8

Browse files
committed
Use fetch_add because the wait is before the operation
1 parent 5886923 commit f38b5a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmdline/bw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void bw_limit(struct snapraid_bw* bw, uint64_t bytes)
3535
uint64_t done;
3636
uint64_t eta;
3737

38-
done = __atomic_add_fetch(&bw->total, bytes, __ATOMIC_SEQ_CST);
38+
done = __atomic_fetch_add(&bw->total, bytes, __ATOMIC_SEQ_CST);
3939

4040
eta = done * 1000 / bw->limit;
4141

0 commit comments

Comments
 (0)