Lines Matching defs:thread

102 // will never be called.  Instead, our own thread destruction hook
118 // Shared setup between thread creation and startup for the initial thread.
122 AsanThread *thread = (AsanThread *)MmapOrDie(AsanThreadMmapSize(), __func__);
124 AsanThreadContext::CreateThreadContextArgs args = {thread, stack};
128 return thread;
132 // We're in the creator thread before the new thread is actually started,
157 // We need to set the current thread before calling AsanThread::Init() below,
158 // since it reads the thread ID.
169 // This is called before each thread creation is attempted. So, in
170 // its first call, the calling thread is the initial and sole thread.
175 // Strict init-order checking is thread-hostile.
182 AsanThread *thread = CreateAsanThread(&stack, parent_tid, detached, name);
185 // thread itself. But on Fuchsia we already know the stack address
188 thread->Init(&options);
189 return thread;
192 // This is called after creating a new thread (in the creating thread),
195 AsanThread *thread = static_cast<AsanThread *>(hook);
197 // The thread was created successfully.
198 // ThreadStartHook is already running in the new thread.
200 // The thread wasn't created after all.
202 asanThreadRegistry().FinishThread(thread->tid());
203 UnmapOrDie(thread, AsanThreadMmapSize());
207 // This is called in the newly-created thread before it runs anything else,
211 AsanThread *thread = static_cast<AsanThread *>(hook);
212 SetCurrentThread(thread);
215 asanThreadRegistry().StartThread(thread->tid(), os_id, ThreadType::Regular,
219 // Each thread runs this just before it exits,
221 // All per-thread destructors have already been called.
254 void *__sanitizer_before_thread_create_hook(thrd_t thread, bool detached,
258 reinterpret_cast<uptr>(thread), detached, name,
262 void __sanitizer_thread_create_hook(void *hook, thrd_t thread, int error) {