Lines Matching full:thread
28 // used to always find the hwasan thread object associated with the current
29 // running thread.
58 // These are known parameters passed to the hwasan runtime on thread creation.
59 struct Thread::InitState {
63 static void FinishThreadInitialization(Thread *thread);
77 // Create the hwasan thread object for the current (main) thread. Stack info in InitThreads()
78 // for this thread is known from information passed via in InitThreads()
80 const Thread::InitState state = { in InitThreads()
90 // This is called from the parent thread before the new thread is created. Here
91 // we can propagate known info like the stack bounds to Thread::Init before
92 // jumping into the thread. We cannot initialize the stack ring buffer yet since
93 // we have not entered the new thread.
97 const Thread::InitState state = { in BeforeThreadCreateHook()
106 void Thread::InitStackAndTls(const InitState *state) { in InitStackAndTls()
114 // This is called after creating a new thread with the pointer returned by
115 // BeforeThreadCreateHook. We are still in the creating thread and should check
118 Thread *thread = static_cast<Thread *>(hook); in ThreadCreateHook() local
120 // The thread was created successfully. in ThreadCreateHook()
121 // ThreadStartHook can already be running in the new thread. in ThreadCreateHook()
123 // The thread wasn't created after all. in ThreadCreateHook()
126 hwasanThreadList().ReleaseThread(thread); in ThreadCreateHook()
130 // This is called in the newly-created thread before it runs anything else,
134 Thread *thread = static_cast<Thread *>(hook); in ThreadStartHook() local
135 FinishThreadInitialization(thread); in ThreadStartHook()
136 thread->EnsureRandomStateInited(); in ThreadStartHook()
140 // GetCurrentThread. This function should only be called while IN the thread
141 // that we want to create the hwasan thread object for so __hwasan_tls can be
143 static void FinishThreadInitialization(Thread *thread) { in FinishThreadInitialization() argument
144 CHECK_NE(thread, nullptr); in FinishThreadInitialization()
146 // The ring buffer is located immediately before the thread object. in FinishThreadInitialization()
148 uptr stack_buffer_start = reinterpret_cast<uptr>(thread) - stack_buffer_size; in FinishThreadInitialization()
149 thread->InitStackRingBuffer(stack_buffer_start, stack_buffer_size); in FinishThreadInitialization()
153 Thread *thread = static_cast<Thread *>(hook); in ThreadExitHook() local
155 hwasanThreadList().ReleaseThread(thread); in ThreadExitHook()
175 // TSD was normally used on linux as a means of calling the hwasan thread exit
215 void *__sanitizer_before_thread_create_hook(thrd_t thread, bool detached, in __sanitizer_before_thread_create_hook() argument
219 reinterpret_cast<uptr>(thread), detached, name, in __sanitizer_before_thread_create_hook()
223 void __sanitizer_thread_create_hook(void *hook, thrd_t thread, int error) { in __sanitizer_thread_create_hook() argument