Commit de866ca
fix: use InterlockedExchangeAdd for Windows atomic ops to return old value
Replace InterlockedAdd/InterlockedIncrement/InterlockedDecrement with
InterlockedExchangeAdd which returns the value before the operation,
matching the behavior of __sync_fetch_and_add (GCC) and
atomic_fetch_add (C11).
Also fix ATOMIC_SUB macro parenthesization: -(n) instead of -n.
Co-authored-by: ithewei <26049660+ithewei@users.noreply.github.com>1 parent dec4b90 commit de866ca
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
0 commit comments