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 | 0f9f15db742f9abe6141df0819cd0fd577c06a3d (patch) | |
tree | 3720c792c577c29d1369fec7c88842dd6a57f563 /lib/lsan/lsan_thread.cc | |
parent | 9e60082e3f68e8619ffc917bbdaaf0636c3fcaa3 (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300473 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/lsan/lsan_thread.cc')
-rw-r--r-- | lib/lsan/lsan_thread.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/lsan/lsan_thread.cc b/lib/lsan/lsan_thread.cc index 09eeb9c24..0ea7a6e97 100644 --- a/lib/lsan/lsan_thread.cc +++ b/lib/lsan/lsan_thread.cc @@ -77,7 +77,7 @@ u32 ThreadCreate(u32 parent_tid, uptr user_id, bool detached) { /* arg */ nullptr); } -void ThreadStart(u32 tid, uptr os_id) { +void ThreadStart(u32 tid, tid_t os_id) { OnStartedArgs args; uptr stack_size = 0; uptr tls_size = 0; @@ -127,7 +127,7 @@ void EnsureMainThreadIDIsCorrect() { ///// Interface to the common LSan module. ///// -bool GetThreadRangesLocked(uptr os_id, uptr *stack_begin, uptr *stack_end, +bool GetThreadRangesLocked(tid_t os_id, uptr *stack_begin, uptr *stack_end, uptr *tls_begin, uptr *tls_end, uptr *cache_begin, uptr *cache_end, DTLS **dtls) { ThreadContext *context = static_cast<ThreadContext *>( @@ -143,7 +143,7 @@ bool GetThreadRangesLocked(uptr os_id, uptr *stack_begin, uptr *stack_end, return true; } -void ForEachExtraStackRange(uptr os_id, RangeIteratorCallback callback, +void ForEachExtraStackRange(tid_t os_id, RangeIteratorCallback callback, void *arg) { } |