diff options
| author | Kuba Mracek <mracek@apple.com> | 2017-04-17 18:17:38 +0000 | 
|---|---|---|
| committer | Kuba Mracek <mracek@apple.com> | 2017-04-17 18:17:38 +0000 | 
| commit | ceb30b0717456feeae9a6c9142169b9e39cc8eff (patch) | |
| tree | 1a1acd350702ca35f3cf073289d9811875d860f1 /compiler-rt/lib/tsan/rtl/tsan_debugging.cc | |
| parent | dfe2ffe8c55de9536cc72636698a5db1f2246269 (diff) | |
| download | bcm5719-llvm-ceb30b0717456feeae9a6c9142169b9e39cc8eff.tar.gz bcm5719-llvm-ceb30b0717456feeae9a6c9142169b9e39cc8eff.zip  | |
[sanitizer] Introduce tid_t as a typedef for OS-provided thread IDs
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).
Differential Revision: https://reviews.llvm.org/D31774
llvm-svn: 300473
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_debugging.cc')
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_debugging.cc | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_debugging.cc b/compiler-rt/lib/tsan/rtl/tsan_debugging.cc index 06154bc135a..a44b13632c6 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_debugging.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_debugging.cc @@ -151,7 +151,7 @@ int __tsan_get_report_mutex(void *report, uptr idx, uptr *mutex_id, void **addr,  }  SANITIZER_INTERFACE_ATTRIBUTE -int __tsan_get_report_thread(void *report, uptr idx, int *tid, uptr *os_id, +int __tsan_get_report_thread(void *report, uptr idx, int *tid, tid_t *os_id,                               int *running, const char **name, int *parent_tid,                               void **trace, uptr trace_size) {    const ReportDesc *rep = (ReportDesc *)report; @@ -228,7 +228,7 @@ const char *__tsan_locate_address(uptr addr, char *name, uptr name_size,  SANITIZER_INTERFACE_ATTRIBUTE  int __tsan_get_alloc_stack(uptr addr, uptr *trace, uptr size, int *thread_id, -                           uptr *os_id) { +                           tid_t *os_id) {    MBlock *b = 0;    Allocator *a = allocator();    if (a->PointerIsMine((void *)addr)) {  | 

