[compiler-rt] [TSAN] Add __tsan_check_no_mutexes_held helper (PR #69372)

Kenny Yu via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 15:17:02 PDT 2023


================
@@ -0,0 +1,19 @@
+// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
+#include "test.h"
+
+pthread_mutex_t mtx;
+
+void *ThreadFunc(void *) {
+  pthread_mutex_lock(&mtx);
+  pthread_mutex_unlock(&mtx);
+  __tsan_check_no_mutexes_held();
+}
+
+int main() {
+  pthread_t th;
+  pthread_create(&th, 0, ThreadFunc, NULL);
----------------
kennyyu wrote:

Will remove

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


More information about the llvm-commits mailing list