21 #ifdef COIL_HAS_ATOMIC_ADD 23 #define atomic_add(x, y) ::InterlockedExchangeAdd(x, y) 24 #define atomic_incr(x) ::InterlockedIncrement(x) 25 #define atomic_decr(x) ::InterlockedDecrement(x) 26 #define atomic_exchange_add(x, y) ::InterlockedExchangeAdd(x, y) 29 #include <coil/Mutex.h> 30 #include <coil/Guard.h> 32 #define atomic_add(x, y) \ 34 coil::Guard<coil::Mutex> guard(__mutex); \ 38 #define atomic_incr(x) \ 40 coil::Guard<coil::Mutex> guard(__mutex); \ 44 #define atomic_decr(x) \ 46 coil::Guard<coil::Mutex> guard(__mutex); \ 58 #define atomic_exchange_add(x, y) \ 59 exchange_add(x, y, &__mutex) 61 #endif // COIL_HAS_ATOMIC_ADD 62 #endif // COIL_ATOMIC_H
int exchange_add(int *x, int y, coil::Mutex *mutex)