Home | History | Annotate | Download | only in hwasan

Lines Matching refs:Thread

25 // used to always find the hwasan thread object associated with the current
26 // running thread.
55 // These are known parameters passed to the hwasan runtime on thread creation.
56 struct Thread::InitState {
60 static void FinishThreadInitialization(Thread *thread);
74 // Create the hwasan thread object for the current (main) thread. Stack info
75 // for this thread is known from information passed via
77 const Thread::InitState state = {
87 // This is called from the parent thread before the new thread is created. Here
88 // we can propagate known info like the stack bounds to Thread::Init before
89 // jumping into the thread. We cannot initialize the stack ring buffer yet since
90 // we have not entered the new thread.
94 const Thread::InitState state = {
103 void Thread::InitStackAndTls(const InitState *state) {
111 // This is called after creating a new thread with the pointer returned by
112 // BeforeThreadCreateHook. We are still in the creating thread and should check
115 Thread *thread = static_cast<Thread *>(hook);
117 // The thread was created successfully.
118 // ThreadStartHook can already be running in the new thread.
120 // The thread wasn't created after all.
123 hwasanThreadList().ReleaseThread(thread);
127 // This is called in the newly-created thread before it runs anything else,
131 Thread *thread = static_cast<Thread *>(hook);
132 FinishThreadInitialization(thread);
133 thread->EnsureRandomStateInited();
137 // GetCurrentThread. This function should only be called while IN the thread
138 // that we want to create the hwasan thread object for so __hwasan_tls can be
140 static void FinishThreadInitialization(Thread *thread) {
141 CHECK_NE(thread, nullptr);
143 // The ring buffer is located immediately before the thread object.
145 uptr stack_buffer_start = reinterpret_cast<uptr>(thread) - stack_buffer_size;
146 thread->InitStackRingBuffer(stack_buffer_start, stack_buffer_size);
150 Thread *thread = static_cast<Thread *>(hook);
152 hwasanThreadList().ReleaseThread(thread);
172 // TSD was normally used on linux as a means of calling the hwasan thread exit
193 void *__sanitizer_before_thread_create_hook(thrd_t thread, bool detached,
197 reinterpret_cast<uptr>(thread), detached, name,
201 void __sanitizer_thread_create_hook(void *hook, thrd_t thread, int error) {