tsan: add another missing windows atomic operation

llvm-svn: 202852
This commit is contained in:
Dmitry Vyukov 2014-03-04 14:21:42 +00:00
parent 0a650fe711
commit 30076b0244
1 changed files with 13 additions and 0 deletions

View File

@ -176,6 +176,19 @@ INLINE bool atomic_compare_exchange_strong(volatile atomic_uintptr_t *a,
return false;
}
INLINE bool atomic_compare_exchange_strong(volatile atomic_uint32_t *a,
u32 *cmp,
u32 xchg,
memory_order mo) {
u32 cmpv = *cmp;
u32 prev = (u32)_InterlockedCompareExchange(
(volatile long*)&a->val_dont_use, (long)xchg, (long)cmpv);
if (prev == cmpv)
return true;
*cmp = prev;
return false;
}
template<typename T>
INLINE bool atomic_compare_exchange_weak(volatile T *a,
typename T::Type *cmp,