cyberdelia / atomic

An atomic class that guarantees atomic updates to its contained value.
https://atomic.readthedocs.org
MIT License
24 stars 5 forks source link

Incorrect parameters on for call to InterlockedCompareExchange in _reference.c #6

Closed aabdullah-bos closed 11 years ago

aabdullah-bos commented 11 years ago

Line 95, in _reference.c has the code:

if (InterlockedCompareExchange(&self->value, new_value, old_value))

The code should read:

if (InterlockedCompareExchange(&self->value, expect_value, new_value)

since old_value is not defined in the function Reference_compare_and_set.

Currently, when building on a windows system the following error is returned during compilation:

atomic/_reference.c(95) : error C2065: 'old_value' : undeclared identifier

error: command '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.ex e"' failed with exit status 2