diff --git a/include/bx/cpu.h b/include/bx/cpu.h index d5ef1d3..4c16237 100644 --- a/include/bx/cpu.h +++ b/include/bx/cpu.h @@ -141,7 +141,7 @@ namespace bx do { oldVal = newVal; - newVal = atomicCompareAndSwap(_ptr, oldVal, newVal <= _test ? _test : newVal+1); + newVal = atomicCompareAndSwap(_ptr, oldVal, newVal <= _test ? _test : newVal-1); } while (oldVal != newVal);