[PATCH] [Tsan] Fix the thread_name tests to build on FreeBSD

Alexey Samsonov vonosmas at gmail.com
Mon Oct 20 16:40:50 PDT 2014


+dmitry

Dmitry, PTAL at this patch. Also, do we have the list of annotations documented or described anywhere? Shouldn't we make a public header containing them at some point? Forcing users to declare them with "extern "C"" is ugly.

================
Comment at: lib/tsan/rtl/tsan_interface_ann.cc:425
@@ +424,3 @@
+    uptr thread, char *f, int l, char *name) {
+  SCOPED_ANNOTATION(AnnotateThreadName);
+  ctx->thread_registry->SetThreadNameByUserId(thread, name);
----------------
Don't you need to use another name here?

================
Comment at: test/tsan/thread_name.cc:7
@@ +6,3 @@
+#if defined(__linux__)
+#define USE_PTHREAD_SETNAME_NP GLIBC_PREREQ(2, 12)
+#else
----------------
Shouldn't it be __GLIBC_PREREQ(2, 12) ?

http://reviews.llvm.org/D5855






More information about the llvm-commits mailing list