[compiler-rt] [scudo] Add ScopedTSD to avoid releasing TSD manually (PR #80061)

Christopher Ferris via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 11:03:55 PST 2024


================
@@ -229,11 +229,25 @@ struct TestConditionVariableConfig {
 #define SCUDO_TYPED_TEST(FIXTURE, NAME)                                        \
   template <class TypeParam>                                                   \
   struct FIXTURE##NAME : public FIXTURE<TypeParam> {                           \
+    using BaseT = FIXTURE<TypeParam>;                                          \
     void Run();                                                                \
   };                                                                           \
   SCUDO_TYPED_TEST_ALL_TYPES(FIXTURE, NAME)                                    \
   template <class TypeParam> void FIXTURE##NAME<TypeParam>::Run()
 
+// Accessing `TSD->getCache()` requires `TSD::Mutex` and which doesn't have easy
+// way to test it by thread-safety analysis. Alternatively, we verify the thread
+// safety through runtime check in ScopedTSD and mark the test body with
----------------
cferris1000 wrote:

through runtime check -> through a runtime check

https://github.com/llvm/llvm-project/pull/80061


More information about the llvm-commits mailing list