Home
last modified time | relevance | path

Searched refs:curthread (Results 1 – 25 of 684) sorted by relevance

12345678910>>...28

/trueos/lib/libkse/thread/
HDthr_mutex.c277 struct pthread *curthread = _get_curthread(); in _pthread_mutex_destroy() local
285 THR_LOCK_ACQUIRE(curthread, &(*mutex)->m_lock); in _pthread_mutex_destroy()
296 THR_LOCK_RELEASE(curthread, &(*mutex)->m_lock); in _pthread_mutex_destroy()
306 THR_LOCK_RELEASE(curthread, &m->m_lock); in _pthread_mutex_destroy()
356 mutex_trylock_common(struct pthread *curthread, pthread_mutex_t *mutex) in mutex_trylock_common() argument
365 THR_LOCK_ACQUIRE(curthread, &(*mutex)->m_lock); in mutex_trylock_common()
385 (*mutex)->m_owner = curthread; in mutex_trylock_common()
389 TAILQ_INSERT_TAIL(&curthread->mutexq, in mutex_trylock_common()
391 } else if ((*mutex)->m_owner == curthread) in mutex_trylock_common()
403 (*mutex)->m_owner = curthread; in mutex_trylock_common()
[all …]
HDthr_cancel.c17 checkcancel(struct pthread *curthread) in checkcancel() argument
19 if ((curthread->cancelflags & THR_CANCELLING) != 0) { in checkcancel()
25 if ((curthread->flags & THR_FLAGS_EXITING) != 0) { in checkcancel()
30 curthread->cancelflags &= ~THR_CANCELLING; in checkcancel()
33 if ((curthread->cancelflags & PTHREAD_CANCEL_DISABLE) == 0) { in checkcancel()
34 curthread->cancelflags &= ~THR_CANCELLING; in checkcancel()
42 testcancel(struct pthread *curthread) in testcancel() argument
44 if (checkcancel(curthread) != 0) { in testcancel()
46 THR_THREAD_UNLOCK(curthread, curthread); in testcancel()
57 struct pthread *curthread = _get_curthread(); in _pthread_cancel() local
[all …]
HDthr_join.c43 struct pthread *curthread = _get_curthread(); in _pthread_join() local
48 _thr_cancel_enter(curthread); in _pthread_join()
53 _thr_cancel_leave(curthread, 1); in _pthread_join()
58 if (pthread == curthread) { in _pthread_join()
60 _thr_cancel_leave(curthread, 1); in _pthread_join()
68 if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/1)) != 0) { in _pthread_join()
70 _thr_cancel_leave(curthread, 1); in _pthread_join()
74 THR_SCHED_LOCK(curthread, pthread); in _pthread_join()
77 THR_SCHED_UNLOCK(curthread, pthread); in _pthread_join()
79 _thr_ref_delete(curthread, pthread); in _pthread_join()
[all …]
HDthr_cond.c142 struct pthread *curthread = _get_curthread(); in _pthread_cond_destroy() local
149 THR_LOCK_ACQUIRE(curthread, &(*cond)->c_lock); in _pthread_cond_destroy()
159 THR_LOCK_RELEASE(curthread, &cv->c_lock); in _pthread_cond_destroy()
178 struct pthread *curthread = _get_curthread(); in _pthread_cond_wait() local
209 THR_LOCK_ACQUIRE(curthread, &(*cond)->c_lock); in _pthread_cond_wait()
231 curthread->timeout = 0; in _pthread_cond_wait()
232 curthread->interrupted = 0; in _pthread_cond_wait()
238 cond_queue_enq(*cond, curthread); in _pthread_cond_wait()
241 curthread->wakeup_time.tv_sec = -1; in _pthread_cond_wait()
251 cond_queue_remove(*cond, curthread); in _pthread_cond_wait()
[all …]
HDthr_sig.c182 struct pthread *curthread = _get_curthread(); in sig_daemon() local
184 DBG_MSG("signal daemon started(%p)\n", curthread); in sig_daemon()
186 curthread->name = strdup("signal thread"); in sig_daemon()
306 struct pthread *curthread; in _thr_sig_handler() local
317 curthread = _get_curthread(); in _thr_sig_handler()
318 if (curthread == NULL) in _thr_sig_handler()
320 if (!(curthread->attr.flags & PTHREAD_SCOPE_SYSTEM)) in _thr_sig_handler()
322 if (curthread->flags & THR_FLAGS_EXITING) { in _thr_sig_handler()
332 if (_kse_in_critical() || THR_IN_CRITICAL(curthread) || in _thr_sig_handler()
333 curthread->state != PS_RUNNING) { in _thr_sig_handler()
[all …]
HDthr_kern.c168 static void thr_cleanup(struct kse *kse, struct pthread *curthread);
171 static void thr_resume_check(struct pthread *curthread, ucontext_t *ucp);
174 static void thr_destroy(struct pthread *curthread, struct pthread *thread);
210 _kse_single_thread(struct pthread *curthread) in _kse_single_thread() argument
228 __sys_sigprocmask(SIG_SETMASK, &curthread->sigmask, NULL); in _kse_single_thread()
231 curthread->kse->k_kcb->kcb_kmbx.km_curthread = NULL; in _kse_single_thread()
232 curthread->attr.flags &= ~PTHREAD_SCOPE_PROCESS; in _kse_single_thread()
233 curthread->attr.flags |= PTHREAD_SCOPE_SYSTEM; in _kse_single_thread()
248 if (thread != curthread) { in _kse_single_thread()
252 thr_destroy(curthread, thread); in _kse_single_thread()
[all …]
HDthr_exit.c67 struct pthread *curthread = _get_curthread(); in _thr_exit_cleanup() local
77 _mutex_unlock_private(curthread); in _thr_exit_cleanup()
88 struct pthread *curthread = _get_curthread(); in _pthread_exit() local
93 if ((curthread->flags & THR_FLAGS_EXITING) != 0) { in _pthread_exit()
97 "1996 s16.2.5.2 does not allow this!", curthread); in _pthread_exit()
105 THR_SCHED_LOCK(curthread, curthread); in _pthread_exit()
106 curthread->flags |= THR_FLAGS_EXITING; in _pthread_exit()
107 THR_SCHED_UNLOCK(curthread, curthread); in _pthread_exit()
120 if (curthread->check_pending) in _pthread_exit()
121 _thr_sig_check_pending(curthread); in _pthread_exit()
[all …]
HDthr_sigwait.c59 struct pthread *curthread = _get_curthread(); in lib_sigtimedwait() local
67 if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) { in lib_sigtimedwait()
91 KSE_SCHED_LOCK(curthread->kse, curthread->kseg); in lib_sigtimedwait()
94 SIGISMEMBER(curthread->sigpend, i)) { in lib_sigtimedwait()
95 SIGDELSET(curthread->sigpend, i); in lib_sigtimedwait()
96 siginfo = curthread->siginfo[i - 1]; in lib_sigtimedwait()
97 KSE_SCHED_UNLOCK(curthread->kse, in lib_sigtimedwait()
98 curthread->kseg); in lib_sigtimedwait()
104 curthread->timeout = 0; in lib_sigtimedwait()
105 curthread->interrupted = 0; in lib_sigtimedwait()
[all …]
HDthr_sigsuspend.c49 struct pthread *curthread = _get_curthread(); in _sigsuspend() local
53 if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) in _sigsuspend()
60 THR_LOCK_SWITCH(curthread); in _sigsuspend()
63 oldmask = curthread->sigmask; in _sigsuspend()
64 curthread->oldsigmask = &oldmask; in _sigsuspend()
67 curthread->sigmask = newmask; in _sigsuspend()
68 tempset = curthread->sigpend; in _sigsuspend()
71 THR_SET_STATE(curthread, PS_SIGSUSPEND); in _sigsuspend()
73 _thr_sched_switch_unlocked(curthread); in _sigsuspend()
75 curthread->check_pending = 1; in _sigsuspend()
[all …]
HDthr_spec.c53 struct pthread *curthread; in _pthread_key_create() local
58 curthread = _get_curthread(); in _pthread_key_create()
61 THR_LOCK_ACQUIRE(curthread, &_keytable_lock); in _pthread_key_create()
70 THR_LOCK_RELEASE(curthread, &_keytable_lock); in _pthread_key_create()
77 THR_LOCK_RELEASE(curthread, &_keytable_lock); in _pthread_key_create()
84 struct pthread *curthread = _get_curthread(); in _pthread_key_delete() local
89 THR_LOCK_ACQUIRE(curthread, &_keytable_lock); in _pthread_key_delete()
97 THR_LOCK_RELEASE(curthread, &_keytable_lock); in _pthread_key_delete()
106 struct pthread *curthread = _get_curthread(); in _thread_cleanupspecific() local
112 if (curthread->specific == NULL) in _thread_cleanupspecific()
[all …]
HDthr_sigmask.c48 struct pthread *curthread = _get_curthread(); in _pthread_sigmask() local
52 if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) { in _pthread_sigmask()
57 __sys_sigprocmask(SIG_SETMASK, NULL, &curthread->sigmask); in _pthread_sigmask()
64 THR_SCHED_LOCK(curthread, curthread); in _pthread_sigmask()
69 oldset = curthread->sigmask; in _pthread_sigmask()
78 SIGSETOR(curthread->sigmask, newset); in _pthread_sigmask()
84 SIGSETNAND(curthread->sigmask, newset); in _pthread_sigmask()
90 curthread->sigmask = newset; in _pthread_sigmask()
99 SIG_CANTMASK(curthread->sigmask); in _pthread_sigmask()
100 THR_SCHED_UNLOCK(curthread, curthread); in _pthread_sigmask()
[all …]
/trueos/lib/libthr/thread/
HDthr_syscalls.c105 struct pthread *curthread; in __thr_accept() local
108 curthread = _get_curthread(); in __thr_accept()
109 _thr_cancel_enter(curthread); in __thr_accept()
111 _thr_cancel_leave(curthread, ret == -1); in __thr_accept()
123 struct pthread *curthread; in __thr_accept4() local
126 curthread = _get_curthread(); in __thr_accept4()
127 _thr_cancel_enter(curthread); in __thr_accept4()
129 _thr_cancel_leave(curthread, ret == -1); in __thr_accept4()
138 struct pthread *curthread; in __thr_aio_suspend() local
141 curthread = _get_curthread(); in __thr_aio_suspend()
[all …]
HDthr_suspend_np.c50 struct pthread *curthread = _get_curthread(); in _pthread_suspend_np() local
58 else if ((ret = _thr_ref_add(curthread, thread, /*include dead*/0)) in _pthread_suspend_np()
61 THR_THREAD_LOCK(curthread, thread); in _pthread_suspend_np()
62 suspend_common(curthread, thread, 1); in _pthread_suspend_np()
64 THR_THREAD_UNLOCK(curthread, thread); in _pthread_suspend_np()
67 _thr_ref_delete(curthread, thread); in _pthread_suspend_np()
73 _thr_suspend_all_lock(struct pthread *curthread) in _thr_suspend_all_lock() argument
77 THR_LOCK_ACQUIRE(curthread, &_suspend_all_lock); in _thr_suspend_all_lock()
81 THR_LOCK_RELEASE(curthread, &_suspend_all_lock); in _thr_suspend_all_lock()
83 THR_LOCK_ACQUIRE(curthread, &_suspend_all_lock); in _thr_suspend_all_lock()
[all …]
HDthr_cancel.c42 testcancel(struct pthread *curthread) in testcancel() argument
44 if (__predict_false(SHOULD_CANCEL(curthread) && in testcancel()
45 !THR_IN_CRITICAL(curthread))) in testcancel()
50 _thr_testcancel(struct pthread *curthread) in _thr_testcancel() argument
52 testcancel(curthread); in _thr_testcancel()
58 struct pthread *curthread = _get_curthread(); in _pthread_cancel() local
66 if ((ret = _thr_find_thread(curthread, pthread, 0)) == 0) { in _pthread_cancel()
72 THR_THREAD_UNLOCK(curthread, pthread); in _pthread_cancel()
80 struct pthread *curthread = _get_curthread(); in _pthread_setcancelstate() local
83 oldval = curthread->cancel_enable; in _pthread_setcancelstate()
[all …]
HDthr_sig.c69 static void check_cancel(struct pthread *curthread, ucontext_t *ucp);
92 _thr_signal_block(struct pthread *curthread) in _thr_signal_block() argument
95 if (curthread->sigblock > 0) { in _thr_signal_block()
96 curthread->sigblock++; in _thr_signal_block()
99 __sys_sigprocmask(SIG_BLOCK, &_thr_maskset, &curthread->sigmask); in _thr_signal_block()
100 curthread->sigblock++; in _thr_signal_block()
104 _thr_signal_unblock(struct pthread *curthread) in _thr_signal_unblock() argument
106 if (--curthread->sigblock == 0) in _thr_signal_unblock()
107 __sys_sigprocmask(SIG_SETMASK, &curthread->sigmask, NULL); in _thr_signal_unblock()
135 struct pthread *curthread = _get_curthread(); in sigcancel_handler() local
[all …]
HDthr_list.c73 static void thr_destroy(struct pthread *curthread, struct pthread *thread);
95 _thr_gc(struct pthread *curthread) in _thr_gc() argument
101 THREAD_LIST_WRLOCK(curthread); in _thr_gc()
113 THREAD_LIST_UNLOCK(curthread); in _thr_gc()
126 _thr_free(curthread, td); in _thr_gc()
131 _thr_alloc(struct pthread *curthread) in _thr_alloc() argument
136 if (curthread != NULL) { in _thr_alloc()
138 _thr_gc(curthread); in _thr_alloc()
140 THR_LOCK_ACQUIRE(curthread, &free_thread_lock); in _thr_alloc()
145 THR_LOCK_RELEASE(curthread, &free_thread_lock); in _thr_alloc()
[all …]
HDthr_exit.c136 struct pthread *curthread = _get_curthread(); in thread_unwind_stop() local
145 cfa >= (uintptr_t)curthread->unwind_stackend) { in thread_unwind_stop()
149 while ((cur = curthread->cleanup) != NULL && in thread_unwind_stop()
163 struct pthread *curthread = _get_curthread(); in thread_unwind() local
165 curthread->ex.exception_class = 0; in thread_unwind()
166 curthread->ex.exception_cleanup = thread_unwind_cleanup; in thread_unwind()
167 _Unwind_ForcedUnwind(&curthread->ex, thread_unwind_stop, NULL); in thread_unwind()
194 struct pthread *curthread = _get_curthread(); local
197 if (curthread->cancelling) {
201 "1996 s16.2.5.2 does not allow this!", curthread);
[all …]
HDthr_spec.c55 struct pthread *curthread; in _pthread_key_create() local
60 curthread = _get_curthread(); in _pthread_key_create()
62 THR_LOCK_ACQUIRE(curthread, &_keytable_lock); in _pthread_key_create()
70 THR_LOCK_RELEASE(curthread, &_keytable_lock); in _pthread_key_create()
76 THR_LOCK_RELEASE(curthread, &_keytable_lock); in _pthread_key_create()
83 struct pthread *curthread; in _pthread_key_delete() local
89 curthread = _get_curthread(); in _pthread_key_delete()
90 THR_LOCK_ACQUIRE(curthread, &_keytable_lock); in _pthread_key_delete()
97 THR_LOCK_RELEASE(curthread, &_keytable_lock); in _pthread_key_delete()
104 struct pthread *curthread; in _thread_cleanupspecific() local
[all …]
HDthr_fork.c81 struct pthread *curthread; in _pthread_atfork() local
89 curthread = _get_curthread(); in _pthread_atfork()
93 THR_CRITICAL_ENTER(curthread); in _pthread_atfork()
97 THR_CRITICAL_LEAVE(curthread); in _pthread_atfork()
105 struct pthread *curthread; in __pthread_cxa_finalize() local
110 curthread = _get_curthread(); in __pthread_cxa_finalize()
111 THR_CRITICAL_ENTER(curthread); in __pthread_cxa_finalize()
122 THR_CRITICAL_LEAVE(curthread); in __pthread_cxa_finalize()
136 struct pthread *curthread; in __thr_fork() local
146 curthread = _get_curthread(); in __thr_fork()
[all …]
HDthr_cond.c164 struct pthread *curthread = _get_curthread(); in cond_wait_kernel() local
173 _thr_cancel_enter2(curthread, 0); in cond_wait_kernel()
177 _thr_cancel_leave(curthread, 0); in cond_wait_kernel()
193 _thr_testcancel(curthread); in cond_wait_kernel()
200 _thr_testcancel(curthread); in cond_wait_kernel()
216 struct pthread *curthread = _get_curthread(); in cond_wait_user() local
222 if (curthread->wchan != NULL) in cond_wait_user()
226 _thr_testcancel(curthread); in cond_wait_user()
236 curthread->mutex_obj = mp; in cond_wait_user()
237 _sleepq_add(cvp, curthread); in cond_wait_user()
[all …]
HDthr_event.c42 _thr_report_creation(struct pthread *curthread, struct pthread *newthread) in _thr_report_creation() argument
44 curthread->event_buf.event = TD_CREATE; in _thr_report_creation()
45 curthread->event_buf.th_p = (uintptr_t)newthread; in _thr_report_creation()
46 curthread->event_buf.data = 0; in _thr_report_creation()
47 THR_UMUTEX_LOCK(curthread, &_thr_event_lock); in _thr_report_creation()
48 _thread_last_event = curthread; in _thr_report_creation()
51 THR_UMUTEX_UNLOCK(curthread, &_thr_event_lock); in _thr_report_creation()
55 _thr_report_death(struct pthread *curthread) in _thr_report_death() argument
57 curthread->event_buf.event = TD_DEATH; in _thr_report_death()
58 curthread->event_buf.th_p = (uintptr_t)curthread; in _thr_report_death()
[all …]
HDthr_create.c47 static void thread_start(struct pthread *curthread);
55 struct pthread *curthread, *new_thread; in _pthread_create() local
76 curthread = _get_curthread(); in _pthread_create()
77 if ((new_thread = _thr_alloc(curthread)) == NULL) in _pthread_create()
94 if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) in _pthread_create()
99 new_thread->attr.prio = curthread->attr.prio; in _pthread_create()
100 new_thread->attr.sched_policy = curthread->attr.sched_policy; in _pthread_create()
108 _thr_free(curthread, new_thread); in _pthread_create()
139 _thr_link(curthread, new_thread); in _pthread_create()
150 if (SHOULD_REPORT_EVENT(curthread, TD_CREATE) || cpusetp != NULL) { in _pthread_create()
[all …]
HDthr_resume_np.c49 struct pthread *curthread = _get_curthread(); in _pthread_resume_np() local
53 if ((ret = _thr_find_thread(curthread, thread, /*include dead*/0)) == 0) { in _pthread_resume_np()
56 THR_THREAD_UNLOCK(curthread, thread); in _pthread_resume_np()
64 struct pthread *curthread = _get_curthread(); in _pthread_resume_all_np() local
68 old_nocancel = curthread->no_cancel; in _pthread_resume_all_np()
69 curthread->no_cancel = 1; in _pthread_resume_all_np()
70 _thr_suspend_all_lock(curthread); in _pthread_resume_all_np()
72 THREAD_LIST_RDLOCK(curthread); in _pthread_resume_all_np()
75 if (thread != curthread) { in _pthread_resume_all_np()
76 THR_THREAD_LOCK(curthread, thread); in _pthread_resume_all_np()
[all …]
HDthr_join.c47 struct pthread *curthread = _get_curthread(); in backout_join() local
49 THR_THREAD_LOCK(curthread, pthread); in backout_join()
51 THR_THREAD_UNLOCK(curthread, pthread); in backout_join()
79 struct pthread *curthread = _get_curthread(); in join_common() local
88 if (pthread == curthread) in join_common()
91 if ((ret = _thr_find_thread(curthread, pthread, 1)) != 0) in join_common()
101 THR_THREAD_UNLOCK(curthread, pthread); in join_common()
105 pthread->joiner = curthread; in join_common()
107 THR_THREAD_UNLOCK(curthread, pthread); in join_common()
109 THR_CLEANUP_PUSH(curthread, backout_join, pthread); in join_common()
[all …]
/trueos/sys/security/audit/
HDaudit.h144 if (AUDITING_TD(curthread)) \
149 if (AUDITING_TD(curthread)) \
154 if (AUDITING_TD(curthread)) \
159 if (AUDITING_TD(curthread)) \
164 if (AUDITING_TD(curthread)) \
169 if (AUDITING_TD(curthread)) \
174 if (AUDITING_TD(curthread)) \
179 if (AUDITING_TD(curthread)) \
184 if (AUDITING_TD(curthread)) \
189 if (AUDITING_TD(curthread)) \
[all …]

12345678910>>...28