mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Use fetch_add because the wait is before the operation
This commit is contained in:
parent
5886923bb1
commit
f38b5a84a8
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue