diff options
Diffstat (limited to 'library/cpp/threading/light_rw_lock')
| -rw-r--r-- | library/cpp/threading/light_rw_lock/lightrwlock.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/library/cpp/threading/light_rw_lock/lightrwlock.h b/library/cpp/threading/light_rw_lock/lightrwlock.h index 931a1817bce..d1ce08fe623 100644 --- a/library/cpp/threading/light_rw_lock/lightrwlock.h +++ b/library/cpp/threading/light_rw_lock/lightrwlock.h @@ -83,21 +83,21 @@ namespace NS_LightRWLock { int prev = __atomic_fetch_and(&item, ~(1 << bit), __ATOMIC_SEQ_CST); return (prev & (1 << bit)) != 0 ? 1 : 0; } -#endif - -#if defined(_x86_64_) || defined(_i386_) || defined (__aarch64__) || defined (__powerpc64__) - static bool AtomicLockHighByte(volatile int& item) { - union TA { - int x; - char y[4]; - }; - - volatile TA* ptr = reinterpret_cast<volatile TA*>(&item); - char zero = 0; - return __atomic_compare_exchange_n(&(ptr->y[3]), &zero, (char)128, true, - __ATOMIC_SEQ_CST, __ATOMIC_RELAXED); - } +#endif +#if defined(_x86_64_) || defined(_i386_) || defined (__aarch64__) || defined (__powerpc64__) + static bool AtomicLockHighByte(volatile int& item) { + union TA { + int x; + char y[4]; + }; + + volatile TA* ptr = reinterpret_cast<volatile TA*>(&item); + char zero = 0; + return __atomic_compare_exchange_n(&(ptr->y[3]), &zero, (char)128, true, + __ATOMIC_SEQ_CST, __ATOMIC_RELAXED); + } + #endif template <typename TInt> |
