Home
last modified time | relevance | path

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

/bionic/libc/bionic/
Dpthread_internal.cpp44 pthread_t __pthread_internal_add(pthread_internal_t* thread) { in __pthread_internal_add() argument
48 thread->next = g_thread_list; in __pthread_internal_add()
49 thread->prev = NULL; in __pthread_internal_add()
50 if (thread->next != NULL) { in __pthread_internal_add()
51 thread->next->prev = thread; in __pthread_internal_add()
53 g_thread_list = thread; in __pthread_internal_add()
54 return reinterpret_cast<pthread_t>(thread); in __pthread_internal_add()
57 void __pthread_internal_remove(pthread_internal_t* thread) { in __pthread_internal_remove() argument
60 if (thread->next != NULL) { in __pthread_internal_remove()
61 thread->next->prev = thread->prev; in __pthread_internal_remove()
[all …]
Dpthread_create.cpp55 void __init_tls(pthread_internal_t* thread) { in __init_tls() argument
57 thread->tls[TLS_SLOT_SELF] = thread->tls; in __init_tls()
58 thread->tls[TLS_SLOT_THREAD_ID] = thread; in __init_tls()
60 thread->tls[TLS_SLOT_STACK_GUARD] = reinterpret_cast<void*>(__stack_chk_guard); in __init_tls()
63 void __init_alternate_signal_stack(pthread_internal_t* thread) { in __init_alternate_signal_stack() argument
78 thread->alternate_signal_stack = stack_base; in __init_alternate_signal_stack()
87 int __init_thread(pthread_internal_t* thread) { in __init_thread() argument
90 if (__predict_true((thread->attr.flags & PTHREAD_ATTR_FLAG_DETACHED) == 0)) { in __init_thread()
91 atomic_init(&thread->join_state, THREAD_NOT_JOINED); in __init_thread()
93 atomic_init(&thread->join_state, THREAD_DETACHED); in __init_thread()
[all …]
Dpthread_exit.cpp47 pthread_internal_t* thread = __get_thread(); in __pthread_cleanup_push() local
50 c->__cleanup_prev = thread->cleanup_stack; in __pthread_cleanup_push()
51 thread->cleanup_stack = c; in __pthread_cleanup_push()
55 pthread_internal_t* thread = __get_thread(); in __pthread_cleanup_pop() local
56 thread->cleanup_stack = c->__cleanup_prev; in __pthread_cleanup_pop()
66 pthread_internal_t* thread = __get_thread(); in pthread_exit() local
67 thread->return_value = return_value; in pthread_exit()
70 while (thread->cleanup_stack) { in pthread_exit()
71 __pthread_cleanup_t* c = thread->cleanup_stack; in pthread_exit()
72 thread->cleanup_stack = c->__cleanup_prev; in pthread_exit()
[all …]
Dpthread_join.cpp39 pthread_internal_t* thread = __pthread_internal_find(t); in pthread_join() local
40 if (thread == NULL) { in pthread_join()
46 !atomic_compare_exchange_weak(&thread->join_state, &old_state, THREAD_JOINED)) { in pthread_join()
53 pid_t tid = thread->tid; in pthread_join()
54 volatile int* tid_ptr = &thread->tid; in pthread_join()
65 *return_value = thread->return_value; in pthread_join()
68 __pthread_internal_remove_and_free(thread); in pthread_join()
D__cxa_thread_atexit_impl.cpp35 pthread_internal_t* thread = __get_thread(); in __cxa_thread_atexit_impl() local
36 dtor->next = thread->thread_local_dtors; in __cxa_thread_atexit_impl()
37 thread->thread_local_dtors = dtor; in __cxa_thread_atexit_impl()
42 pthread_internal_t* thread = __get_thread(); in __cxa_thread_finalize() local
43 while (thread->thread_local_dtors != nullptr) { in __cxa_thread_finalize()
44 thread_local_dtor* current = thread->thread_local_dtors; in __cxa_thread_finalize()
45 thread->thread_local_dtors = current->next; in __cxa_thread_finalize()
Dpthread_getschedparam.cpp37 pthread_internal_t* thread = __pthread_internal_find(t); in pthread_getschedparam() local
38 if (thread == NULL) { in pthread_getschedparam()
42 int rc = sched_getparam(thread->tid, param); in pthread_getschedparam()
46 *policy = sched_getscheduler(thread->tid); in pthread_getschedparam()
Dpthread_getcpuclockid.cpp34 pthread_internal_t* thread = __pthread_internal_find(t); in pthread_getcpuclockid() local
35 if (thread == NULL) { in pthread_getcpuclockid()
40 clockid_t result = ~static_cast<clockid_t>(thread->tid) << 3; in pthread_getcpuclockid()
Dpthread_setschedparam.cpp37 pthread_internal_t* thread = __pthread_internal_find(t); in pthread_setschedparam() local
38 if (thread == NULL) { in pthread_setschedparam()
42 int rc = sched_setscheduler(thread->tid, policy, param); in pthread_setschedparam()
Dpthread_kill.cpp40 pthread_internal_t* thread = __pthread_internal_find(t); in pthread_kill() local
41 if (thread == NULL) { in pthread_kill()
45 return (tgkill(getpid(), thread->tid, sig) == -1) ? errno : 0; in pthread_kill()
Dpthread_detach.cpp35 pthread_internal_t* thread = __pthread_internal_find(t); in pthread_detach() local
36 if (thread == NULL) { in pthread_detach()
42 !atomic_compare_exchange_weak(&thread->join_state, &old_state, THREAD_DETACHED)) { in pthread_detach()
Dpthread_internal.h115 __LIBC_HIDDEN__ int __init_thread(pthread_internal_t* thread);
116 __LIBC_HIDDEN__ void __init_tls(pthread_internal_t* thread);
119 __LIBC_HIDDEN__ pthread_t __pthread_internal_add(pthread_internal_t* thread);
121 __LIBC_HIDDEN__ void __pthread_internal_remove(pthread_internal_t* thread);
122 __LIBC_HIDDEN__ void __pthread_internal_remove_and_free(pthread_internal_t* thread);
Dpthread_setname_np.cpp60 pthread_internal_t* thread = __pthread_internal_find(t); in pthread_setname_np() local
61 if (thread == NULL) { in pthread_setname_np()
64 pid_t tid = thread->tid; in pthread_setname_np()
Dpthread_attr.cpp200 pthread_internal_t* thread = reinterpret_cast<pthread_internal_t*>(t); in pthread_getattr_np() local
201 *attr = thread->attr; in pthread_getattr_np()
204 if (atomic_load(&thread->join_state) == THREAD_DETACHED) { in pthread_getattr_np()
209 if (thread->tid == getpid()) { in pthread_getattr_np()
/bionic/benchmarks/
Dpthread_benchmark.cpp130 pthread_t thread; in BM_pthread_create() local
131 pthread_create(&thread, NULL, IdleThread, NULL); in BM_pthread_create()
133 pthread_join(thread, NULL); in BM_pthread_create()
147 pthread_t thread; in BM_pthread_create_and_run() local
148 pthread_create(&thread, NULL, RunThread, &state); in BM_pthread_create_and_run()
149 pthread_join(thread, NULL); in BM_pthread_create_and_run()
164 pthread_t thread; in BM_pthread_exit_and_join() local
165 pthread_create(&thread, NULL, ExitThread, &state); in BM_pthread_exit_and_join()
166 pthread_join(thread, NULL); in BM_pthread_exit_and_join()
/bionic/tests/
Dsemaphore_test.cpp195 pthread_t thread; in TEST() local
196 ASSERT_EQ(0, pthread_create(&thread, nullptr, SemWaitEINTRThreadFn, &s)); in TEST()
199 ASSERT_EQ(0, pthread_kill(thread, SIGUSR1)); in TEST()
204 ASSERT_EQ(0, pthread_join(thread, &result)); in TEST()
218 pthread_t thread; in TEST() local
219 ASSERT_EQ(0, pthread_create(&thread, nullptr, SemWaitEINTRThreadFn, &s)); in TEST()
222 ASSERT_EQ(0, pthread_kill(thread, SIGUSR1)); in TEST()
227 ASSERT_EQ(0, pthread_join(thread, &result)); in TEST()
Dstdio_ext_test.cpp155 pthread_t thread; in TEST() local
157 ASSERT_EQ(0, pthread_create(&thread, nullptr, in TEST()
162 ASSERT_EQ(0, pthread_join(thread, nullptr)); in TEST()
Dpthread_test.cpp757 pthread_t thread; in test_pthread_rwlock_reader_wakeup_writer() local
758 ASSERT_EQ(0, pthread_create(&thread, NULL, in test_pthread_rwlock_reader_wakeup_writer()
766 ASSERT_EQ(0, pthread_join(thread, NULL)); in test_pthread_rwlock_reader_wakeup_writer()
793 pthread_t thread; in test_pthread_rwlock_writer_wakeup_reader() local
794 ASSERT_EQ(0, pthread_create(&thread, NULL, in test_pthread_rwlock_writer_wakeup_reader()
802 ASSERT_EQ(0, pthread_join(thread, NULL)); in test_pthread_rwlock_writer_wakeup_reader()
853 pthread_t thread; in TEST() local
854 ASSERT_EQ(0, pthread_create(&thread, nullptr, in TEST()
859 ASSERT_EQ(0, pthread_join(thread, nullptr)); in TEST()
874 pthread_t thread; in TEST() local
[all …]
Dsys_socket_test.cpp79 pthread_t thread; in RunTest() local
80 ASSERT_EQ(0, pthread_create(&thread, NULL, ConnectFn, &connect_data)); in RunTest()
93 ASSERT_EQ(0, pthread_join(thread, &ret_val)); in RunTest()
/bionic/libm/i387/
Dnpx.h151 void npxexit(struct thread *td);
153 int npxgetregs(struct thread *td, union savefpu *addr);
156 void npxsetregs(struct thread *td, union savefpu *addr);
/bionic/libc/malloc_debug/tests/
Dmalloc_debug_unit_tests.cpp930 std::vector<std::thread*> threads(1000); in TEST_F()
932 threads[i] = new std::thread([](){ in TEST_F()
/bionic/
DREADME.md26 thread-safe static initialization and the like, so it just calls functions that
/bionic/libc/
DAndroid.bp166 // has already set up the main thread's TLS.
195 // Obviously, we want to be thread-safe.