[PATCH] [Msan] Fix the pthread_getattr_np_deadlock.cc to build and pass on FreeBSD

Viktor Kutuzov vkutuzov at accesssoftek.com
Thu May 7 05:23:22 PDT 2015


Hi kcc, samsonov, eugenis,

http://reviews.llvm.org/D9553

Files:
  test/msan/pthread_getattr_np_deadlock.cc

Index: test/msan/pthread_getattr_np_deadlock.cc
===================================================================
--- test/msan/pthread_getattr_np_deadlock.cc
+++ test/msan/pthread_getattr_np_deadlock.cc
@@ -5,8 +5,14 @@
 #include <assert.h>
 #include <pthread.h>
 
+#if defined(__FreeBSD__)
+#include <pthread_np.h>
+#define pthread_getattr_np pthread_attr_get_np
+#endif
+
 void *ThreadFn(void *) {
   pthread_attr_t attr;
+  pthread_attr_init(&attr);
   int res = pthread_getattr_np(pthread_self(), &attr);
   assert(!res);
   return 0;

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9553.25165.patch
Type: text/x-patch
Size: 542 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150507/b53b3127/attachment.bin>


More information about the llvm-commits mailing list