Home | History | Annotate | Download | only in bionic

Lines Matching defs:thread

63 pthread_t __pthread_internal_add(pthread_internal_t* thread) {
67 thread->next = g_thread_list;
68 thread->prev = nullptr;
69 if (thread->next != nullptr) {
70 thread->next->prev = thread;
72 g_thread_list = thread;
73 return reinterpret_cast<pthread_t>(thread);
76 void __pthread_internal_remove(pthread_internal_t* thread) {
79 if (thread->next != nullptr) {
80 thread->next->prev = thread->prev;
82 if (thread->prev != nullptr) {
83 thread->prev->next = thread->next;
85 g_thread_list = thread->next;
89 static void __pthread_internal_free(pthread_internal_t* thread) {
90 if (thread->mmap_size != 0) {
91 // Free mapped space, including thread stack and pthread_internal_t.
92 munmap(thread->attr.stack_base, thread->mmap_size);
96 void __pthread_internal_remove_and_free(pthread_internal_t* thread) {
97 __pthread_internal_remove(thread);
98 __pthread_internal_free(thread);
102 pthread_internal_t* thread = reinterpret_cast<pthread_internal_t*>(thread_id);
105 if (thread == __get_thread()) return thread;
112 if (t == thread) return thread;
118 if (thread == nullptr) {
120 // there will never be a valid thread at address 0, whereas other invalid
126 async_safe_fatal("invalid pthread_t %p passed to libc", thread);