Home
last modified time | relevance | path

Searched refs:thread (Results 1 – 25 of 37) sorted by relevance

12

/bionic/libc/bionic/
Dpthread_internal.cpp45 pthread_t __pthread_internal_add(pthread_internal_t* thread) { in __pthread_internal_add() argument
49 thread->next = g_thread_list; in __pthread_internal_add()
50 thread->prev = nullptr; in __pthread_internal_add()
51 if (thread->next != nullptr) { in __pthread_internal_add()
52 thread->next->prev = thread; in __pthread_internal_add()
54 g_thread_list = thread; in __pthread_internal_add()
55 return reinterpret_cast<pthread_t>(thread); in __pthread_internal_add()
58 void __pthread_internal_remove(pthread_internal_t* thread) { in __pthread_internal_remove() argument
61 if (thread->next != nullptr) { in __pthread_internal_remove()
62 thread->next->prev = thread->prev; in __pthread_internal_remove()
[all …]
Dpthread_exit.cpp52 pthread_internal_t* thread = __get_thread(); in __pthread_cleanup_push() local
55 c->__cleanup_prev = thread->cleanup_stack; in __pthread_cleanup_push()
56 thread->cleanup_stack = c; in __pthread_cleanup_push()
61 pthread_internal_t* thread = __get_thread(); in __pthread_cleanup_pop() local
62 thread->cleanup_stack = c->__cleanup_prev; in __pthread_cleanup_pop()
73 pthread_internal_t* thread = __get_thread(); in pthread_exit() local
74 thread->return_value = return_value; in pthread_exit()
77 while (thread->cleanup_stack) { in pthread_exit()
78 __pthread_cleanup_t* c = thread->cleanup_stack; in pthread_exit()
79 thread->cleanup_stack = c->__cleanup_prev; in pthread_exit()
[all …]
Dpthread_create.cpp59 void __init_tcb(bionic_tcb* tcb, pthread_internal_t* thread) { in __init_tcb() argument
65 tcb->tls_slot(TLS_SLOT_THREAD_ID) = thread; in __init_tcb()
83 tcb->thread()->bionic_tls = tls; in __init_bionic_tls_ptrs()
106 static void __init_alternate_signal_stack(pthread_internal_t* thread) { in __init_alternate_signal_stack() argument
120 thread->alternate_signal_stack = stack_base; in __init_alternate_signal_stack()
128 static void __init_shadow_call_stack(pthread_internal_t* thread __unused) { in __init_shadow_call_stack()
133 thread->shadow_call_stack_guard_region = scs_guard_region; in __init_shadow_call_stack()
154 void __init_additional_stacks(pthread_internal_t* thread) { in __init_additional_stacks() argument
155 __init_alternate_signal_stack(thread); in __init_additional_stacks()
156 __init_shadow_call_stack(thread); in __init_additional_stacks()
[all …]
Dpthread_join.cpp43 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.cpp42 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()
Dpthread_detach.cpp37 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()
Dpthread_internal.h156 __LIBC_HIDDEN__ void __init_tcb(bionic_tcb* tcb, pthread_internal_t* thread);
163 __LIBC_HIDDEN__ int __init_thread(pthread_internal_t* thread);
166 __LIBC_HIDDEN__ pthread_t __pthread_internal_add(pthread_internal_t* thread);
169 __LIBC_HIDDEN__ void __pthread_internal_remove(pthread_internal_t* thread);
170 __LIBC_HIDDEN__ void __pthread_internal_remove_and_free(pthread_internal_t* thread);
Dpthread_attr.cpp244 pthread_internal_t* thread = reinterpret_cast<pthread_internal_t*>(t); in pthread_getattr_np() local
245 *attr = thread->attr; in pthread_getattr_np()
248 if (atomic_load(&thread->join_state) == THREAD_DETACHED) { in pthread_getattr_np()
253 if (thread->tid == getpid()) { in pthread_getattr_np()
/bionic/tests/
Delftls_test.cpp52 std::thread([] { in TEST()
60 std::thread([] { in TEST()
71 std::thread([] { in TEST()
86 std::thread([] { in TEST()
Dleak_test.cpp113 pthread_t thread; in TEST() local
114 … ASSERT_EQ(0, pthread_create(&thread, nullptr, [](void*) -> void* { return nullptr; }, nullptr)); in TEST()
115 ASSERT_EQ(0, pthread_join(thread, nullptr)); in TEST()
145 pthread_t thread; in TEST() local
146 ASSERT_EQ(0, pthread_create(&thread, nullptr, thread_function, &threads[i])); in TEST()
147 ASSERT_EQ(0, pthread_detach(thread)); in TEST()
Dsemaphore_test.cpp208 pthread_t thread; in TEST() local
209 ASSERT_EQ(0, pthread_create(&thread, nullptr, SemWaitEINTRThreadFn, &s)); in TEST()
212 ASSERT_EQ(0, pthread_kill(thread, SIGUSR1)); in TEST()
217 ASSERT_EQ(0, pthread_join(thread, &result)); in TEST()
231 pthread_t thread; in TEST() local
232 ASSERT_EQ(0, pthread_create(&thread, nullptr, SemWaitEINTRThreadFn, &s)); in TEST()
235 ASSERT_EQ(0, pthread_kill(thread, SIGUSR1)); in TEST()
240 ASSERT_EQ(0, pthread_join(thread, &result)); in TEST()
Delftls_dl_test.cpp61 std::thread([bump_shared_var] { in TEST()
99 std::thread([bump_shared_var] { in TEST()
113 std::thread([bump_local_vars] { in TEST()
127 std::thread([] { in TEST()
145 std::thread([missing_weak_dyn_tls_addr] { in TEST()
282 std::thread([lib] { in TEST()
299 std::thread([lib, get_var_addr] { in TEST()
Dpty_test.cpp138 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()
Dpthread_test.cpp551 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()
954 pthread_t thread; in test_pthread_rwlock_reader_wakeup_writer() local
955 ASSERT_EQ(0, pthread_create(&thread, nullptr, in test_pthread_rwlock_reader_wakeup_writer()
963 ASSERT_EQ(0, pthread_join(thread, nullptr)); in test_pthread_rwlock_reader_wakeup_writer()
1002 pthread_t thread; in test_pthread_rwlock_writer_wakeup_reader() local
1003 ASSERT_EQ(0, pthread_create(&thread, nullptr, in test_pthread_rwlock_writer_wakeup_reader()
1011 ASSERT_EQ(0, pthread_join(thread, nullptr)); in test_pthread_rwlock_writer_wakeup_reader()
1076 pthread_t thread; in pthread_rwlock_timedrdlock_timeout_helper() local
[all …]
Dstdio_ext_test.cpp230 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()
Dsystem_properties_test.cpp365 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()
Dsys_socket_test.cpp81 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()
Dsignal_test.cpp175 std::thread thread([&pid]() { in TEST() local
186 thread.join(); in TEST()
650 pthread_t thread; in TEST() local
651 int rc = pthread_create(&thread, nullptr, in TEST()
662 ASSERT_EQ(0, pthread_sigqueue(thread, SIGALRM, sigval)); in TEST()
664 pthread_join(thread, nullptr); in TEST()
/bionic/benchmarks/
Dpthread_benchmark.cpp180 pthread_t thread; in BM_pthread_create() local
181 pthread_create(&thread, nullptr, IdleThread, nullptr); in BM_pthread_create()
183 pthread_join(thread, nullptr); in BM_pthread_create()
195 pthread_t thread; in BM_pthread_create_and_run() local
196 pthread_create(&thread, nullptr, RunThread, &state); in BM_pthread_create_and_run()
197 pthread_join(thread, nullptr); in BM_pthread_create_and_run()
208 pthread_t thread; in BM_pthread_exit_and_join() local
209 pthread_create(&thread, nullptr, ExitThread, nullptr); in BM_pthread_exit_and_join()
210 pthread_join(thread, nullptr); in BM_pthread_exit_and_join()
/bionic/libc/malloc_debug/tools/
Dgen_malloc.pl185 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/private/
Dbionic_tls.h74 pthread_internal_t* thread() { in thread() function
/bionic/docs/
Dfdsan.md8 …n *never* be noticed on the thread on which the error occurred, and will manifest as "impossible" …
29 thread one thread two
38 …ulnerabilities are also possible (e.g. suppose thread two was saving user data to disk when a thir…
68 …a simple contrived example that uses sleeps to force a particular interleaving of thread execution.
75 #include <thread>
109 std::vector<std::thread> threads;
113 for (auto& thread : threads) {
114 thread.join();
Dstatus.md244 As part of a long-term goal to remove the global thread list,
253 old lookup only held the global thread list lock for the duration of
259 We can't check a thread's tid against 0 to see whether a `pthread_t`
260 is still valid because a dead thread gets its thread struct unmapped
270 `pthread_detach(pthread_self());` from the new thread's start routine
273 * `pthread_join` calls should be safe anyway, because a joinable thread
275 unjoinable thread, the fix is to stop marking it detached. If you're
276 joining an already-joined thread, you need to rethink your design!
280 use `pthread_gettid_np` at some point that you know the thread to be
Delf-tls.md12 ELF TLS is a system for automatically allocating thread-local variables with cooperation among the
24 architecture-specific thread pointer (TP) and can be accessed very efficiently -- typically just a
31 architecture-specific thread-pointer ([`__get_tls()`] in Bionic):
42 thread-specific data layout, but variant 1 is more problematic than variant 2.
44 Each thread has a "Dynamic Thread Vector" (DTV) with a pointer to each module's TLS block (or NULL
108 1. If the current thread's DTV generation count is less than the current global TLS generation, then
176 // TPOFF is directly relative to the thread pointer.
220 In general, supporting surplus TLS memory probably requires maintaining a thread list so that
221 `dlopen` can initialize the new static TLS memory in all existing threads. A thread list could be
299 struct TlsDtv { // DTV == dynamic thread vector
[all …]
/bionic/tools/versioner/src/
DDriver.cpp219 std::vector<std::thread> threads; in initializeTargetCC1FlagCache()
231 for (auto& thread : threads) { in initializeTargetCC1FlagCache() local
232 thread.join(); in initializeTargetCC1FlagCache()

12