Browse Source

Try enable TSAN on report unit-tests

Включаем TSAN над юнит-тестами репорта + для реализации TLightGuard-ов делаем фолбэк на обычные гарды в режиме сборки с санитайзерами.
nechda 1 year ago
parent
commit
90c0a74f0d

+ 1 - 1
library/cpp/threading/light_rw_lock/lightrwlock.cpp

@@ -1,7 +1,7 @@
 #include "lightrwlock.h"
 #include <util/system/spinlock.h>
 
-#if defined(_linux_)
+#if defined(_linux_) && !defined(_tsan_enabled_)
 
 using namespace NS_LightRWLock;
 

+ 3 - 1
library/cpp/threading/light_rw_lock/lightrwlock.h

@@ -3,7 +3,9 @@
 #include <util/system/rwlock.h>
 #include <util/system/sanitizers.h>
 
-#if defined(_linux_)
+// TLightRWLock and TSAN are not friends...
+
+#if defined(_linux_) && !defined(_tsan_enabled_)
 /* TLightRWLock is optimized for read lock and very fast lock/unlock switching.
    Read lock increments counter.
    Write lock sets highest bit of counter (makes counter negative).