[all-commits] [llvm/llvm-project] f9a706: [TSan][Darwin] Avoid calling pthread_self() before...

Julian Lettner via All-commits all-commits at lists.llvm.org
Mon Dec 16 13:11:49 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f9a706a36ae5dcb87b0b6649d0c80e989400f48e
      https://github.com/llvm/llvm-project/commit/f9a706a36ae5dcb87b0b6649d0c80e989400f48e
  Author: Julian Lettner <julian.lettner at apple.com>
  Date:   2019-12-16 (Mon, 16 Dec 2019)

  Changed paths:
    M compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp

  Log Message:
  -----------
  [TSan][Darwin] Avoid calling pthread_self() before libpthread is initialized

This skips calling `pthread_self` when `main_thread_identity` hasn't
been initialized yet.  `main_thread_identity` is only ever assigned in
`__tsan::InitializePlatform`.  This change should be relatively safe; we
are not changing behavior other than skipping the call to `pthread_self`
when `main_thread_identity == 0`.

rdar://57822138

Reviewed By: kubamracek

Differential Revision: https://reviews.llvm.org/D71559




More information about the All-commits mailing list