| /freebsd/lib/libthr/thread/ |
| H A D | thr_syscalls.c | 100 struct pthread *curthread; in __thr_accept() local 103 curthread = _get_curthread(); in __thr_accept() 104 _thr_cancel_enter(curthread); in __thr_accept() 106 _thr_cancel_leave(curthread, ret == -1); in __thr_accept() 118 struct pthread *curthread; in __thr_accept4() local 121 curthread = _get_curthread(); in __thr_accept4() 122 _thr_cancel_enter(curthread); in __thr_accept4() 124 _thr_cancel_leave(curthread, ret == -1); in __thr_accept4() 133 struct pthread *curthread; in __thr_aio_suspend() local 136 curthread = _get_curthread(); in __thr_aio_suspend() [all …]
|
| H A D | thr_sig.c | 72 static void check_cancel(struct pthread *curthread, ucontext_t *ucp); 95 thr_signal_block_slow(struct pthread *curthread) in thr_signal_block_slow() argument 97 if (curthread->sigblock > 0) { in thr_signal_block_slow() 98 curthread->sigblock++; in thr_signal_block_slow() 101 __sys_sigprocmask(SIG_BLOCK, &_thr_maskset, &curthread->sigmask); in thr_signal_block_slow() 102 curthread->sigblock++; in thr_signal_block_slow() 106 thr_signal_unblock_slow(struct pthread *curthread) in thr_signal_unblock_slow() argument 108 if (--curthread->sigblock == 0) in thr_signal_unblock_slow() 109 __sys_sigprocmask(SIG_SETMASK, &curthread->sigmask, NULL); in thr_signal_unblock_slow() 113 thr_signal_block_fast(struct pthread *curthread) in thr_signal_block_fast() argument [all …]
|
| H A D | thr_suspend_np.c | 51 struct pthread *curthread = _get_curthread(); in _pthread_suspend_np() local 59 else if ((ret = _thr_ref_add(curthread, thread, /*include dead*/0)) in _pthread_suspend_np() 62 THR_THREAD_LOCK(curthread, thread); in _pthread_suspend_np() 63 suspend_common(curthread, thread, 1); in _pthread_suspend_np() 65 THR_THREAD_UNLOCK(curthread, thread); in _pthread_suspend_np() 68 _thr_ref_delete(curthread, thread); in _pthread_suspend_np() 74 _thr_suspend_all_lock(struct pthread *curthread) in _thr_suspend_all_lock() argument 78 THR_LOCK_ACQUIRE(curthread, &_suspend_all_lock); in _thr_suspend_all_lock() 82 THR_LOCK_RELEASE(curthread, &_suspend_all_lock); in _thr_suspend_all_lock() 84 THR_LOCK_ACQUIRE(curthread, &_suspend_all_lock); in _thr_suspend_all_lock() [all …]
|
| H A D | thr_malloc.c | 57 thr_malloc_lock(struct pthread *curthread) in thr_malloc_lock() argument 61 if (curthread == NULL) in thr_malloc_lock() 63 curthread->locklevel++; in thr_malloc_lock() 64 curtid = TID(curthread); in thr_malloc_lock() 72 thr_malloc_unlock(struct pthread *curthread) in thr_malloc_unlock() argument 75 if (curthread == NULL) in thr_malloc_unlock() 80 _thr_umutex_unlock(&thr_malloc_umtx, TID(curthread)); in thr_malloc_unlock() 81 curthread->locklevel--; in thr_malloc_unlock() 82 _thr_ast(curthread); in thr_malloc_unlock() 88 struct pthread *curthread; in __thr_calloc() local [all …]
|
| H A D | thr_list.c | 75 static void thr_destroy(struct pthread *curthread, struct pthread *thread); 97 _thr_gc(struct pthread *curthread) in _thr_gc() argument 103 THREAD_LIST_WRLOCK(curthread); in _thr_gc() 115 THREAD_LIST_UNLOCK(curthread); in _thr_gc() 128 _thr_free(curthread, td); in _thr_gc() 133 _thr_alloc(struct pthread *curthread) in _thr_alloc() argument 138 if (curthread != NULL) { in _thr_alloc() 140 _thr_gc(curthread); in _thr_alloc() 142 THR_LOCK_ACQUIRE(curthread, &free_thread_lock); in _thr_alloc() 147 THR_LOCK_RELEASE(curthread, &free_thread_lock); in _thr_alloc() [all …]
|
| H A D | thr_cancel.c | 47 testcancel(struct pthread *curthread) in testcancel() argument 49 if (__predict_false(SHOULD_CANCEL(curthread) && in testcancel() 50 !THR_IN_CRITICAL(curthread))) in testcancel() 55 _thr_testcancel(struct pthread *curthread) in _thr_testcancel() argument 57 testcancel(curthread); in _thr_testcancel() 63 struct pthread *curthread = _get_curthread(); in _thr_cancel() local 71 if ((ret = _thr_find_thread(curthread, pthread, 1)) == 0) { in _thr_cancel() 77 THR_THREAD_UNLOCK(curthread, pthread); in _thr_cancel() 85 struct pthread *curthread = _get_curthread(); in _thr_setcancelstate() local 99 oldval = atomic_swap_int(&curthread->cancel_enable, val); in _thr_setcancelstate() [all …]
|
| H A D | thr_exit.c | 137 struct pthread *curthread = _get_curthread(); in thread_unwind_stop() local 146 cfa >= (uintptr_t)curthread->unwind_stackend) { in thread_unwind_stop() 150 while ((cur = curthread->cleanup) != NULL && in thread_unwind_stop() 168 struct pthread *curthread = _get_curthread(); in thread_unwind() local 170 curthread->ex.exception_class = 0; in thread_unwind() 171 curthread->ex.exception_cleanup = thread_unwind_cleanup; in thread_unwind() 172 _Unwind_ForcedUnwind(&curthread->ex, thread_unwind_stop, NULL); in thread_unwind() 212 struct pthread *curthread = _get_curthread(); local 215 if (curthread->cancelling) 218 "1996 s16.2.5.2 does not allow this!", curthread); [all …]
|
| H A D | thr_spec.c | 59 struct pthread *curthread; in _thr_key_create() local 64 curthread = _get_curthread(); in _thr_key_create() 66 THR_LOCK_ACQUIRE(curthread, &_keytable_lock); in _thr_key_create() 74 THR_LOCK_RELEASE(curthread, &_keytable_lock); in _thr_key_create() 80 THR_LOCK_RELEASE(curthread, &_keytable_lock); in _thr_key_create() 87 struct pthread *curthread; in _thr_key_delete() local 93 curthread = _get_curthread(); in _thr_key_delete() 94 THR_LOCK_ACQUIRE(curthread, &_keytable_lock); in _thr_key_delete() 101 THR_LOCK_RELEASE(curthread, &_keytable_lock); in _thr_key_delete() 108 struct pthread *curthread; in _thread_cleanupspecific() local [all …]
|
| H A D | thr_cond.c | 207 struct pthread *curthread; in cond_wait_kernel() local 210 curthread = _get_curthread(); in cond_wait_kernel() 211 robust = _mutex_enter_robust(curthread, mp); in cond_wait_kernel() 216 _mutex_leave_robust(curthread, mp); in cond_wait_kernel() 221 _thr_cancel_enter2(curthread, 0); in cond_wait_kernel() 225 _thr_cancel_leave(curthread, 0); in cond_wait_kernel() 243 _mutex_leave_robust(curthread, mp); in cond_wait_kernel() 246 _thr_testcancel(curthread); in cond_wait_kernel() 256 _mutex_leave_robust(curthread, mp); in cond_wait_kernel() 259 _thr_testcancel(curthread); in cond_wait_kernel() [all …]
|
| H A D | thr_rtld.c | 98 if (curthread != _thr_initial) \ 99 errsave = curthread->error; \ 105 if (curthread != _thr_initial) \ 106 curthread->error = errsave; \ 114 struct pthread *curthread; in _thr_rtld_rlock_acquire() local 118 curthread = _get_curthread(); in _thr_rtld_rlock_acquire() 122 if (l->wowner == curthread) { in _thr_rtld_rlock_acquire() 125 THR_CRITICAL_ENTER(curthread); in _thr_rtld_rlock_acquire() 129 curthread->rdlock_count++; in _thr_rtld_rlock_acquire() 136 struct pthread *curthread; in _thr_rtld_wlock_acquire() local [all …]
|
| H A D | thr_fork.c | 84 struct pthread *curthread; in _thr_atfork() local 95 curthread = _get_curthread(); in _thr_atfork() 96 THR_CRITICAL_ENTER(curthread); in _thr_atfork() 100 THR_CRITICAL_LEAVE(curthread); in _thr_atfork() 112 struct pthread *curthread; in __pthread_cxa_finalize() local 117 curthread = _get_curthread(); in __pthread_cxa_finalize() 118 THR_CRITICAL_ENTER(curthread); in __pthread_cxa_finalize() 129 THR_CRITICAL_LEAVE(curthread); in __pthread_cxa_finalize() 152 struct pthread *curthread; in thr_fork_impl() local 171 curthread = _get_curthread(); in thr_fork_impl() [all …]
|
| H A D | thr_create.c | 51 static void thread_start(struct pthread *curthread); 62 struct pthread *curthread, *new_thread; in _pthread_create() local 82 curthread = _get_curthread(); in _pthread_create() 83 if ((new_thread = _thr_alloc(curthread)) == NULL) in _pthread_create() 100 if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) in _pthread_create() 105 new_thread->attr.prio = curthread->attr.prio; in _pthread_create() 106 new_thread->attr.sched_policy = curthread->attr.sched_policy; in _pthread_create() 114 _thr_free(curthread, new_thread); in _pthread_create() 145 _thr_link(curthread, new_thread); in _pthread_create() 156 if (SHOULD_REPORT_EVENT(curthread, TD_CREATE) || cpusetp != NULL) { in _pthread_create() [all …]
|
| H A D | thr_event.c | 42 _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 …]
|
| H A D | thr_join.c | 50 backout_join(struct pthread *pthread, struct pthread *curthread) in backout_join() argument 52 THR_THREAD_LOCK(curthread, pthread); in backout_join() 54 THR_THREAD_UNLOCK(curthread, pthread); in backout_join() 61 struct pthread *curthread = _get_curthread(); in backout_join_pop() local 63 backout_join(pthread, curthread); in backout_join_pop() 96 join_common_joined(struct pthread *pthread, struct pthread *curthread, in join_common_joined() argument 104 _thr_try_gc(curthread, pthread); /* thread lock released */ in join_common_joined() 118 struct pthread *curthread = _get_curthread(); in join_common() local 126 if (pthread == curthread) in join_common() 129 if ((ret = _thr_find_thread(curthread, pthread, 1)) != 0) in join_common() [all …]
|
| H A D | thr_mutex.c | 80 static void mutex_init_robust(struct pthread *curthread); 143 mutex_assert_not_owned(struct pthread *curthread __unused, in mutex_assert_not_owned() 154 (is_pshared_mutex(m) && curthread->robust_list == in mutex_assert_not_owned() 156 (!is_pshared_mutex(m) && curthread->priv_robust_list == in mutex_assert_not_owned() 161 m->m_rb_prev, (void *)curthread->robust_list, in mutex_assert_not_owned() 162 (void *)curthread->priv_robust_list); in mutex_assert_not_owned() 181 _mutex_enter_robust(struct pthread *curthread, struct pthread_mutex *m) in _mutex_enter_robust() argument 185 if (__predict_false(curthread->inact_mtx != 0)) in _mutex_enter_robust() 191 mutex_init_robust(curthread); in _mutex_enter_robust() 192 curthread->inact_mtx = (uintptr_t)&m->m_lock; in _mutex_enter_robust() [all …]
|
| H A D | thr_pshared.c | 67 pshared_rlock(struct pthread *curthread) in pshared_rlock() argument 70 curthread->locklevel++; in pshared_rlock() 75 pshared_wlock(struct pthread *curthread) in pshared_wlock() argument 78 curthread->locklevel++; in pshared_wlock() 83 pshared_unlock(struct pthread *curthread) in pshared_unlock() argument 87 curthread->locklevel--; in pshared_unlock() 88 _thr_ast(curthread); in pshared_unlock() 102 pshared_gc(struct pthread *curthread) in pshared_gc() argument 108 pshared_wlock(curthread); in pshared_gc() 121 pshared_unlock(curthread); in pshared_gc() [all …]
|
| H A D | thr_resume_np.c | 50 struct pthread *curthread = _get_curthread(); in _pthread_resume_np() local 54 if ((ret = _thr_find_thread(curthread, thread, /*include dead*/0)) == 0) { in _pthread_resume_np() 57 THR_THREAD_UNLOCK(curthread, thread); in _pthread_resume_np() 65 struct pthread *curthread = _get_curthread(); in _thr_resume_all_np() local 69 old_nocancel = curthread->no_cancel; in _thr_resume_all_np() 70 curthread->no_cancel = 1; in _thr_resume_all_np() 71 _thr_suspend_all_lock(curthread); in _thr_resume_all_np() 73 THREAD_LIST_RDLOCK(curthread); in _thr_resume_all_np() 76 if (thread != curthread) { in _thr_resume_all_np() 77 THR_THREAD_LOCK(curthread, thread); in _thr_resume_all_np() [all …]
|
| H A D | thr_info.c | 60 struct pthread *curthread; in _pthread_setname_np() local 71 curthread = _get_curthread(); in _pthread_setname_np() 72 if (curthread == thread) { in _pthread_setname_np() 74 THR_THREAD_LOCK(curthread, thread); in _pthread_setname_np() 79 THR_THREAD_UNLOCK(curthread, thread); in _pthread_setname_np() 82 if (_thr_find_thread(curthread, thread, 0) == 0) { in _pthread_setname_np() 91 THR_THREAD_UNLOCK(curthread, thread); in _pthread_setname_np() 121 struct pthread *curthread; in _thr_getname_np() local 125 curthread = _get_curthread(); in _thr_getname_np() 126 if (curthread == thread) { in _thr_getname_np() [all …]
|
| H A D | thr_clean.c | 59 struct pthread *curthread = _get_curthread(); in __thr_cleanup_push_imp() local 66 newbuf->prev = curthread->cleanup; in __thr_cleanup_push_imp() 67 curthread->cleanup = newbuf; in __thr_cleanup_push_imp() 73 struct pthread *curthread = _get_curthread(); in __thr_cleanup_pop_imp() local 76 if ((old = curthread->cleanup) != NULL) { in __thr_cleanup_pop_imp() 77 curthread->cleanup = old->prev; in __thr_cleanup_pop_imp() 88 struct pthread *curthread = _get_curthread(); in _thr_cleanup_push() local 91 curthread->unwind_disabled = 1; in _thr_cleanup_push() 98 newbuf->prev = curthread->cleanup; in _thr_cleanup_push() 99 curthread->cleanup = newbuf; in _thr_cleanup_push()
|
| H A D | thr_barrier.c | 48 struct pthread *curthread; in _pthread_barrier_destroy() local 65 curthread = _get_curthread(); in _pthread_barrier_destroy() 66 THR_UMUTEX_LOCK(curthread, &bar->b_lock); in _pthread_barrier_destroy() 68 THR_UMUTEX_UNLOCK(curthread, &bar->b_lock); in _pthread_barrier_destroy() 75 THR_UMUTEX_UNLOCK(curthread, &bar->b_lock); in _pthread_barrier_destroy() 80 THR_UMUTEX_LOCK(curthread, &bar->b_lock); in _pthread_barrier_destroy() 85 THR_UMUTEX_UNLOCK(curthread, &bar->b_lock); in _pthread_barrier_destroy() 133 struct pthread *curthread; in _pthread_barrier_wait() local 148 curthread = _get_curthread(); in _pthread_barrier_wait() 149 THR_UMUTEX_LOCK(curthread, &bar->b_lock); in _pthread_barrier_wait() [all …]
|
| H A D | thr_rwlock.c | 171 struct pthread *curthread = _get_curthread(); in rwlock_rdlock_common() local 180 if (curthread->rdlock_count) { in rwlock_rdlock_common() 204 curthread->rdlock_count++; in rwlock_rdlock_common() 225 curthread->rdlock_count++; in rwlock_rdlock_common() 247 struct pthread *curthread; in _Tthr_rwlock_tryrdlock() local 257 curthread = _get_curthread(); in _Tthr_rwlock_tryrdlock() 258 if (curthread->rdlock_count) { in _Tthr_rwlock_tryrdlock() 278 curthread->rdlock_count++; in _Tthr_rwlock_tryrdlock() 285 struct pthread *curthread; in _Tthr_rwlock_trywrlock() local 294 curthread = _get_curthread(); in _Tthr_rwlock_trywrlock() [all …]
|
| /freebsd/tools/sched/ |
| H A D | schedgraph.d | 83 …exit\", attributes: prio:td\n", cpu, timestamp, curthread->td_proc->p_comm, curthread->td_name, cu… 88 …exit\", attributes: prio:td\n", cpu, timestamp, curthread->td_proc->p_comm, curthread->td_name, cu… 93 …e, args[0]->td_tid, args[0]->td_priority, arg2, curthread->td_proc->p_comm, curthread->td_name, cu… 98 …, linkedto:\"%s/%s tid %d\"\n", cpu, timestamp, curthread->td_proc->p_comm, curthread->td_name, cu… 103 …td_name, args[0]->td_tid, args[0]->td_priority, curthread->td_proc->p_comm, curthread->td_name, cu… 104 …: linkedto:\"%s/%s tid %d\"\n", cpu, timestamp, curthread->td_proc->p_comm, curthread->td_name, cu… 109 …td_name, args[0]->td_tid, args[0]->td_priority, curthread->td_proc->p_comm, curthread->td_name, cu… 118 / curthread->td_flags & TDF_IDLETD / 120 …tributes: prio:%d\n", cpu, timestamp, curthread->td_proc->p_comm, curthread->td_name, curthread->t… 124 / (curthread->td_flags & TDF_IDLETD) == 0 / [all …]
|
| /freebsd/sys/security/audit/ |
| H A D | audit.h | 158 if (AUDITING_TD(curthread)) \ 163 if (AUDITING_TD(curthread)) \ 168 if (AUDITING_TD(curthread)) \ 173 if (AUDITING_TD(curthread)) \ 178 if (AUDITING_TD(curthread)) \ 183 if (AUDITING_TD(curthread)) \ 188 if (AUDITING_TD(curthread)) \ 193 if (AUDITING_TD(curthread)) \ 198 if (AUDITING_TD(curthread)) \ 203 if (AUDITING_TD(curthread)) \ [all …]
|
| /freebsd/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/ |
| H A D | fasttrap_isa.c | 221 fill_regs(curthread, &r); in fasttrap_pid_getarg() 232 fill_regs(curthread, &r); in fasttrap_usdt_getarg() 348 fill_regs(curthread, ®); in fasttrap_pid_probe() 358 if (curthread->t_dtrace_step) { in fasttrap_pid_probe() 359 ASSERT(curthread->t_dtrace_on); in fasttrap_pid_probe() 360 fasttrap_sigtrap(p, curthread, pc); in fasttrap_pid_probe() 367 curthread->t_dtrace_ft = 0; in fasttrap_pid_probe() 368 curthread->t_dtrace_pc = 0; in fasttrap_pid_probe() 369 curthread->t_dtrace_npc = 0; in fasttrap_pid_probe() 370 curthread->t_dtrace_scrpc = 0; in fasttrap_pid_probe() [all …]
|
| /freebsd/sys/x86/cpufreq/ |
| H A D | hwpstate_intel.c | 131 thread_lock(curthread); in intel_hwp_dump_sysctl_handler() 132 sched_bind(curthread, pc->pc_cpuid); in intel_hwp_dump_sysctl_handler() 133 thread_unlock(curthread); in intel_hwp_dump_sysctl_handler() 179 thread_lock(curthread); in intel_hwp_dump_sysctl_handler() 180 sched_unbind(curthread); in intel_hwp_dump_sysctl_handler() 181 thread_unlock(curthread); in intel_hwp_dump_sysctl_handler() 258 thread_lock(curthread); in sysctl_epp_select() 259 sched_bind(curthread, pc->pc_cpuid); in sysctl_epp_select() 260 thread_unlock(curthread); in sysctl_epp_select() 317 thread_lock(curthread); in sysctl_epp_select() [all …]
|