Home | History | Annotate | Download | only in hwasan

Lines Matching refs: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
78 // for this thread is known from information passed via
80 const Thread::InitState state = {
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 = {
106 void Thread::InitStackAndTls(const InitState *state) {
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);
120 // The thread was created successfully.
121 // ThreadStartHook can already be running in the new thread.
123 // The thread wasn't created after all.
126 hwasanThreadList().ReleaseThread(thread);
130 // This is called in the newly-created thread before it runs anything else,
134 Thread *thread = static_cast<Thread *>(hook);
135 FinishThreadInitialization(thread);
136 thread->EnsureRandomStateInited();
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) {
144 CHECK_NE(thread, nullptr);
146 // The ring buffer is located immediately before the thread object.
148 uptr stack_buffer_start = reinterpret_cast<uptr>(thread) - stack_buffer_size;
149 thread->InitStackRingBuffer(stack_buffer_start, stack_buffer_size);
153 Thread *thread = static_cast<Thread *>(hook);
155 hwasanThreadList().ReleaseThread(thread);
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,
219 reinterpret_cast<uptr>(thread), detached, name,
223 void __sanitizer_thread_create_hook(void *hook, thrd_t thread, int error) {