[PATCH] D31774: [sanitizer] Introduce tid_t as a typedef for OS-provided thread IDs

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 10:35:49 PDT 2017


kubamracek created this revision.
kubamracek added a project: Sanitizers.
Herald added a subscriber: emaste.

We seem to assume that OS-provided thread IDs are either `uptr` or `int`, neither of which is true on Darwin.  This introduces a `tid_t` type, which holds a OS-provided thread ID (`gettid` on Linux, `pthread_threadid_np` on Darwin, `pthread_self` on FreeBSD).


Repository:
  rL LLVM

https://reviews.llvm.org/D31774

Files:
  lib/asan/asan_thread.cc
  lib/asan/asan_thread.h
  lib/lsan/lsan_common.cc
  lib/lsan/lsan_common.h
  lib/lsan/lsan_thread.cc
  lib/lsan/lsan_thread.h
  lib/sanitizer_common/sanitizer_common.h
  lib/sanitizer_common/sanitizer_internal_defs.h
  lib/sanitizer_common/sanitizer_linux.cc
  lib/sanitizer_common/sanitizer_mac.cc
  lib/sanitizer_common/sanitizer_stoptheworld.h
  lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
  lib/sanitizer_common/sanitizer_thread_registry.cc
  lib/sanitizer_common/sanitizer_thread_registry.h
  lib/sanitizer_common/sanitizer_win.cc
  lib/tsan/rtl/tsan_debugging.cc
  lib/tsan/rtl/tsan_interface.h
  lib/tsan/rtl/tsan_report.h
  lib/tsan/rtl/tsan_rtl.h
  lib/tsan/rtl/tsan_rtl_thread.cc
  test/tsan/Darwin/main_tid.mm
  test/tsan/debug_alloc_stack.cc
  test/tsan/debugging.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31774.94391.patch
Type: text/x-patch
Size: 18992 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170406/1bc264a1/attachment.bin>


More information about the llvm-commits mailing list