diff options
author | Oleg Sidorkin <osidorkin@gmail.com> | 2022-02-10 16:49:36 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:36 +0300 |
commit | f8f6804a3e352897afabc93afcb32081e3fca601 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/threading/light_rw_lock/lightrwlock.h | |
parent | 5ce74d4fee2d42a4b86efc02dfdc704d458760e1 (diff) | |
download | ydb-f8f6804a3e352897afabc93afcb32081e3fca601.tar.gz |
Restoring authorship annotation for Oleg Sidorkin <osidorkin@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/threading/light_rw_lock/lightrwlock.h')
-rw-r--r-- | library/cpp/threading/light_rw_lock/lightrwlock.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/library/cpp/threading/light_rw_lock/lightrwlock.h b/library/cpp/threading/light_rw_lock/lightrwlock.h index d1ce08fe62..931a1817bc 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> |