/bionic/libc/bionic/ |
D | pthread_internal.cpp | 48 pthread_t __pthread_internal_add(pthread_internal_t* thread) { in __pthread_internal_add() argument 52 thread->next = g_thread_list; in __pthread_internal_add() 53 thread->prev = nullptr; in __pthread_internal_add() 54 if (thread->next != nullptr) { in __pthread_internal_add() 55 thread->next->prev = thread; in __pthread_internal_add() 57 g_thread_list = thread; in __pthread_internal_add() 58 return reinterpret_cast<pthread_t>(thread); in __pthread_internal_add() 61 void __pthread_internal_remove(pthread_internal_t* thread) { in __pthread_internal_remove() argument 64 if (thread->next != nullptr) { in __pthread_internal_remove() 65 thread->next->prev = thread->prev; in __pthread_internal_remove() [all …]
|
D | pthread_create.cpp | 66 tcb->thread()->bionic_tls = tls; in __init_bionic_tls_ptrs() 89 static void __init_alternate_signal_stack(pthread_internal_t* thread) { in __init_alternate_signal_stack() argument 103 thread->alternate_signal_stack = stack_base; in __init_alternate_signal_stack() 111 static void __init_shadow_call_stack(pthread_internal_t* thread __unused) { in __init_shadow_call_stack() 116 thread->shadow_call_stack_guard_region = scs_guard_region; in __init_shadow_call_stack() 137 void __init_additional_stacks(pthread_internal_t* thread) { in __init_additional_stacks() argument 138 __init_alternate_signal_stack(thread); in __init_additional_stacks() 139 __init_shadow_call_stack(thread); in __init_additional_stacks() 142 int __init_thread(pthread_internal_t* thread) { in __init_thread() argument 143 thread->cleanup_stack = nullptr; in __init_thread() [all …]
|
D | pthread_exit.cpp | 53 pthread_internal_t* thread = __get_thread(); in __pthread_cleanup_push() local 56 c->__cleanup_prev = thread->cleanup_stack; in __pthread_cleanup_push() 57 thread->cleanup_stack = c; in __pthread_cleanup_push() 62 pthread_internal_t* thread = __get_thread(); in __pthread_cleanup_pop() local 63 thread->cleanup_stack = c->__cleanup_prev; in __pthread_cleanup_pop() 74 pthread_internal_t* thread = __get_thread(); in pthread_exit() local 75 thread->return_value = return_value; in pthread_exit() 78 while (thread->cleanup_stack) { in pthread_exit() 79 __pthread_cleanup_t* c = thread->cleanup_stack; in pthread_exit() 80 thread->cleanup_stack = c->__cleanup_prev; in pthread_exit() [all …]
|
D | pthread_join.cpp | 43 pthread_internal_t* thread = __pthread_internal_find(t, "pthread_join"); in pthread_join() local 44 if (thread == nullptr) { in pthread_join() 50 !atomic_compare_exchange_weak(&thread->join_state, &old_state, THREAD_JOINED)) { in pthread_join() 57 pid_t tid = thread->tid; in pthread_join() 58 volatile int* tid_ptr = &thread->tid; in pthread_join() 69 *return_value = thread->return_value; in pthread_join() 72 __pthread_internal_remove_and_free(thread); in pthread_join()
|
D | __cxa_thread_atexit_impl.cpp | 42 pthread_internal_t* thread = __get_thread(); in __cxa_thread_atexit_impl() local 43 dtor->next = thread->thread_local_dtors; in __cxa_thread_atexit_impl() 44 thread->thread_local_dtors = dtor; in __cxa_thread_atexit_impl() 52 pthread_internal_t* thread = __get_thread(); in __cxa_thread_finalize() local 53 while (thread->thread_local_dtors != nullptr) { in __cxa_thread_finalize() 54 thread_local_dtor* current = thread->thread_local_dtors; in __cxa_thread_finalize() 55 thread->thread_local_dtors = current->next; in __cxa_thread_finalize()
|
D | pthread_detach.cpp | 37 pthread_internal_t* thread = __pthread_internal_find(t, "pthread_detach"); in pthread_detach() local 38 if (thread == nullptr) { in pthread_detach() 44 !atomic_compare_exchange_weak(&thread->join_state, &old_state, THREAD_DETACHED)) { in pthread_detach()
|
D | pthread_internal.h | 176 __LIBC_HIDDEN__ void __init_tcb(bionic_tcb* tcb, pthread_internal_t* thread); 183 __LIBC_HIDDEN__ int __init_thread(pthread_internal_t* thread); 187 __LIBC_HIDDEN__ pthread_t __pthread_internal_add(pthread_internal_t* thread); 190 __LIBC_HIDDEN__ void __pthread_internal_remove(pthread_internal_t* thread); 191 __LIBC_HIDDEN__ void __pthread_internal_remove_and_free(pthread_internal_t* thread);
|
D | pthread_attr.cpp | 245 pthread_internal_t* thread = reinterpret_cast<pthread_internal_t*>(t); in pthread_getattr_np() local 246 *attr = thread->attr; in pthread_getattr_np() 249 if (atomic_load(&thread->join_state) == THREAD_DETACHED) { in pthread_getattr_np() 254 if (thread->tid == getpid()) { in pthread_getattr_np()
|
D | __libc_init_main_thread.cpp | 88 void __init_tcb(bionic_tcb* tcb, pthread_internal_t* thread) { in __init_tcb() argument 94 tcb->tls_slot(TLS_SLOT_THREAD_ID) = thread; in __init_tcb()
|
/bionic/tests/ |
D | leak_test.cpp | 116 pthread_t thread; in TEST() local 118 &thread, nullptr, [](void*) -> void* { return nullptr; }, nullptr)); in TEST() 119 ASSERT_EQ(0, pthread_join(thread, nullptr)); in TEST() 125 &thread, nullptr, [](void*) -> void* { return nullptr; }, nullptr)); in TEST() 126 ASSERT_EQ(0, pthread_join(thread, nullptr)); in TEST() 156 pthread_t thread; in TEST() local 157 ASSERT_EQ(0, pthread_create(&thread, nullptr, thread_function, &threads[i])); in TEST() 158 ASSERT_EQ(0, pthread_detach(thread)); in TEST()
|
D | elftls_test.cpp | 52 std::thread([] { in TEST() 60 std::thread([] { in TEST() 71 std::thread([] { in TEST() 86 std::thread([] { in TEST()
|
D | threads_test.cpp | 74 std::thread([&flag] { in TEST() 98 std::thread t1(waiter); in TEST() 99 std::thread t2(waiter); in TEST() 100 std::thread t3(waiter); in TEST() 143 std::thread t1(waiter); in TEST() 144 std::thread t2(waiter); in TEST() 145 std::thread t3(waiter); in TEST() 204 std::thread t([&c, &m, &done] { in TEST() 288 std::thread([&m] { in TEST() 306 std::thread([&m] { in TEST() [all …]
|
D | malloc_stress_test.cpp | 51 std::vector<std::thread*> threads; in TEST() 53 threads.push_back(new std::thread([]() { in TEST() 65 for (auto thread : threads) { in TEST() local 66 thread->join(); in TEST() 67 delete thread; in TEST()
|
D | semaphore_test.cpp | 225 pthread_t thread; in TEST() local 226 ASSERT_EQ(0, pthread_create(&thread, nullptr, SemWaitEINTRThreadFn, &s)); in TEST() 229 ASSERT_EQ(0, pthread_kill(thread, SIGUSR1)); in TEST() 234 ASSERT_EQ(0, pthread_join(thread, &result)); in TEST() 248 pthread_t thread; in TEST() local 249 ASSERT_EQ(0, pthread_create(&thread, nullptr, SemWaitEINTRThreadFn, &s)); in TEST() 252 ASSERT_EQ(0, pthread_kill(thread, SIGUSR1)); in TEST() 257 ASSERT_EQ(0, pthread_join(thread, &result)); in TEST()
|
D | stack_unwinding_test.cpp | 80 TEST(stack_unwinding, thread) { in TEST() argument 81 pthread_t thread; in TEST() local 82 ASSERT_EQ(0, pthread_create(&thread, nullptr, [](void*) -> void* { in TEST() 87 ASSERT_EQ(0, pthread_join(thread, &retval)); in TEST()
|
D | elftls_dl_test.cpp | 64 std::thread([bump_shared_var] { in TEST() 101 std::thread([bump_shared_var] { in TEST() 115 std::thread([bump_local_vars] { in TEST() 129 std::thread([] { in TEST() 147 std::thread([missing_weak_dyn_tls_addr] { in TEST() 284 std::thread([lib] { in TEST() 301 std::thread([lib, get_var_addr] { in TEST()
|
D | pty_test.cpp | 138 pthread_t thread; in TEST() local 142 ASSERT_EQ(0, pthread_create(&thread, nullptr, in TEST() 162 ASSERT_EQ(0, pthread_join(thread, nullptr)); in TEST()
|
D | pthread_test.cpp | 551 pthread_t thread; in TEST() local 552 ASSERT_EQ(0, pthread_create(&thread, nullptr, in TEST() 565 ASSERT_EQ(ESRCH, pthread_kill(thread, 0)); in TEST() 957 pthread_t thread; in test_pthread_rwlock_reader_wakeup_writer() local 958 ASSERT_EQ(0, pthread_create(&thread, nullptr, in test_pthread_rwlock_reader_wakeup_writer() 966 ASSERT_EQ(0, pthread_join(thread, nullptr)); in test_pthread_rwlock_reader_wakeup_writer() 1024 pthread_t thread; in test_pthread_rwlock_writer_wakeup_reader() local 1025 ASSERT_EQ(0, pthread_create(&thread, nullptr, in test_pthread_rwlock_writer_wakeup_reader() 1033 ASSERT_EQ(0, pthread_join(thread, nullptr)); in test_pthread_rwlock_writer_wakeup_reader() 1117 pthread_t thread; in pthread_rwlock_timedrdlock_timeout_helper() local [all …]
|
D | stdio_ext_test.cpp | 230 pthread_t thread; in TEST() local 232 ASSERT_EQ(0, pthread_create(&thread, nullptr, in TEST() 237 ASSERT_EQ(0, pthread_join(thread, nullptr)); in TEST()
|
D | system_properties_test.cpp | 365 std::thread thread([&system_properties, &flag]() { in TEST() local 376 thread.join(); in TEST() 394 std::thread thread([&system_properties]() { in TEST() local 409 thread.join(); in TEST()
|
D | sys_socket_test.cpp | 81 pthread_t thread; in RunTest() local 82 ASSERT_EQ(0, pthread_create(&thread, nullptr, ConnectFn, &connect_data)); in RunTest() 95 ASSERT_EQ(0, pthread_join(thread, &ret_val)); in RunTest()
|
/bionic/benchmarks/ |
D | pthread_benchmark.cpp | 183 pthread_t thread; in BM_pthread_create() local 184 pthread_create(&thread, nullptr, IdleThread, nullptr); in BM_pthread_create() 186 pthread_join(thread, nullptr); in BM_pthread_create() 198 pthread_t thread; in BM_pthread_create_and_run() local 199 pthread_create(&thread, nullptr, RunThread, &state); in BM_pthread_create_and_run() 200 pthread_join(thread, nullptr); in BM_pthread_create_and_run() 211 pthread_t thread; in BM_pthread_exit_and_join() local 212 pthread_create(&thread, nullptr, ExitThread, nullptr); in BM_pthread_exit_and_join() 213 pthread_join(thread, nullptr); in BM_pthread_exit_and_join()
|
/bionic/libc/malloc_debug/tools/ |
D | gen_malloc.pl | 185 if ($opts->{thread} eq $cur_thread) { 195 my ($thread, $ignore_missing_allocations) = @_; 198 $opts->{thread} = $thread; 242 if ($thread ne $cur_thread) { 319 my $thread = $args[0]; 332 my $total_slots = PrintEntries($thread, $opts->{ignore_missing_allocations});
|
/bionic/libc/malloc_debug/tests/ |
D | malloc_debug_system_tests.cpp | 109 reader_.reset(new std::thread([this, pid, log] { in LogReader() 195 std::unique_ptr<std::thread> reader_; 626 std::thread malloc_thread([&thread_mask, i] { in TEST() 676 std::thread malloc_thread([&thread_mask, &run, &allocs, i] { in TEST() 750 std::thread thread([&tid, &running] { in TEST() local 775 thread.join(); in TEST()
|
/bionic/docs/ |
D | fdsan.md | 12 …n *never* be noticed on the thread on which the error occurred, and will manifest as "impossible" … 33 thread one thread two 42 …ulnerabilities are also possible (e.g. suppose thread two was saving user data to disk when a thir… 72 …a simple contrived example that uses sleeps to force a particular interleaving of thread execution. 79 #include <thread> 113 std::vector<std::thread> threads; 117 for (auto& thread : threads) { 118 thread.join();
|