1 //=-- lsan_thread.h -------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is a part of LeakSanitizer.
11 // Thread registry for standalone LSan.
13 //===----------------------------------------------------------------------===//
18 #include "sanitizer_common/sanitizer_thread_registry.h"
22 class ThreadContext
: public ThreadContextBase
{
24 explicit ThreadContext(int tid
);
25 void OnStarted(void *arg
);
27 uptr
stack_begin() { return stack_begin_
; }
28 uptr
stack_end() { return stack_end_
; }
29 uptr
tls_begin() { return tls_begin_
; }
30 uptr
tls_end() { return tls_end_
; }
31 uptr
cache_begin() { return cache_begin_
; }
32 uptr
cache_end() { return cache_end_
; }
34 uptr stack_begin_
, stack_end_
,
35 cache_begin_
, cache_end_
,
39 void InitializeThreadRegistry();
41 void ThreadStart(u32 tid
, uptr os_id
);
43 u32
ThreadCreate(u32 tid
, uptr uid
, bool detached
);
44 void ThreadJoin(u32 tid
);
45 u32
ThreadTid(uptr uid
);
47 u32
GetCurrentThread();
48 void SetCurrentThread(u32 tid
);
49 ThreadContext
*CurrentThreadContext();
50 void EnsureMainThreadIDIsCorrect();
53 #endif // LSAN_THREAD_H