[PATCH] D14546: [tsan] Add TSan unit test support for OS X

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 11 01:48:06 PST 2015


dvyukov accepted this revision.
dvyukov added a comment.
This revision is now accepted and ready to land.

LGTM with a nit


================
Comment at: lib/tsan/tests/rtl/tsan_test_util_linux.cc:143
@@ -129,2 +142,3 @@
     CHECK_EQ(pthread_mutex_destroy((pthread_mutex_t*)mtx_), 0);
+#ifndef __APPLE__
   else if (type_ == Spin)
----------------
Tests can rely on the fact that this is an actual mutex that provides actual synchronization. You turn it into no-op. It's probably not super important (as no tests fail and we do not add any more of these tests), but I think it is better to define Spin to Normal on mac:

  enum Type {
    Normal,
    RW,
#ifndef __APPLE__
    Spin
#else
    // because ...
    Spin = Normal
#endif
  };

This way it is still a mutex from point of view of both execution and tsan.


http://reviews.llvm.org/D14546





More information about the llvm-commits mailing list