/dragonfly/lib/libthread_xu/thread/ |
H A D | thr_syscalls.c | 169 pthread_t curthread; in __accept() local 173 curthread = tls_get_curthread(); in __accept() 176 _thr_cancel_leave(curthread, oldcancel); in __accept() 193 _thr_cancel_leave(curthread, oldcancel); in _aio_suspend() 209 _thr_cancel_leave(curthread, oldcancel); in __close() 225 _thr_cancel_leave(curthread, oldcancel); in __connect() 241 _thr_cancel_leave(curthread, oldcancel); in ___creat() 276 _thr_cancel_leave(curthread, oldcancel); in __fcntl() 292 _thr_cancel_leave(curthread, oldcancel); in __fsync() 308 _thr_cancel_leave(curthread, oldcancel); in __fdatasync() [all …]
|
H A D | thr_suspend_np.c | 49 if (thread == curthread) in _pthread_suspend_np() 56 THR_THREAD_LOCK(curthread, thread); in _pthread_suspend_np() 62 _thr_ref_delete(curthread, thread); in _pthread_suspend_np() 74 THREAD_LIST_LOCK(curthread); in _pthread_suspend_all_np() 77 if (thread != curthread) { in _pthread_suspend_all_np() 78 THR_THREAD_LOCK(curthread, thread); in _pthread_suspend_all_np() 89 if (thread != curthread) { in _pthread_suspend_all_np() 91 THR_THREAD_LOCK(curthread, thread); in _pthread_suspend_all_np() 96 THREAD_LIST_UNLOCK(curthread); in _pthread_suspend_all_np() 99 THREAD_LIST_LOCK(curthread); in _pthread_suspend_all_np() [all …]
|
H A D | thr_exit.c | 117 curthread->ret = status; in _pthread_exit() 143 THREAD_LIST_LOCK(curthread); in exit_thread() 146 THREAD_LIST_UNLOCK(curthread); in exit_thread() 150 THR_LOCK(curthread); in exit_thread() 151 curthread->state = PS_DEAD; in exit_thread() 152 THR_UNLOCK(curthread); in exit_thread() 153 curthread->refcount--; in exit_thread() 155 THR_GCLIST_ADD(curthread); in exit_thread() 156 THREAD_LIST_UNLOCK(curthread); in exit_thread() 157 if (curthread->joiner) in exit_thread() [all …]
|
H A D | thr_list.c | 104 _thr_gc(pthread_t curthread) in _thr_gc() argument 110 THREAD_LIST_LOCK(curthread); in _thr_gc() 145 _thr_free(curthread, td); in _thr_gc() 155 if (curthread != NULL) { in _thr_alloc() 157 _thr_gc(curthread); in _thr_alloc() 172 if (curthread != NULL) { in _thr_alloc() 202 if (curthread != NULL) { in _thr_free() 241 THREAD_LIST_LOCK(curthread); in _thr_link() 259 THREAD_LIST_LOCK(curthread); in _thr_unlink() 309 THREAD_LIST_LOCK(curthread); in _thr_ref_add() [all …]
|
H A D | thr_sig.c | 67 _thr_ast(curthread); in sigcancel_handler() 71 _thr_ast(pthread_t curthread) in _thr_ast() argument 97 THR_UMTX_LOCK(curthread, &(curthread)->lock); in _thr_suspend_check() 100 curthread->cycle++; in _thr_suspend_check() 101 cycle = curthread->cycle; in _thr_suspend_check() 113 THR_UMTX_UNLOCK(curthread, &(curthread)->lock); in _thr_suspend_check() 115 THR_UMTX_LOCK(curthread, &(curthread)->lock); in _thr_suspend_check() 118 THR_UMTX_UNLOCK(curthread, &(curthread)->lock); in _thr_suspend_check() 294 pthread_t curthread; in _thr_log() local 300 if (curthread) { in _thr_log() [all …]
|
H A D | thr_fork.c | 89 pthread_t curthread; in _pthread_atfork() local 96 curthread = tls_get_curthread(); in _pthread_atfork() 120 pthread_t curthread; in _thr_atfork_kern() local 125 curthread = tls_get_curthread(); in _thr_atfork_kern() 137 pthread_t curthread; in __pthread_cxa_finalize() local 140 curthread = tls_get_curthread(); in __pthread_cxa_finalize() 168 pthread_t curthread; in _fork() local 180 curthread = tls_get_curthread(); in _fork() 219 _thr_signal_block(curthread); in _fork() 267 _mutex_fork(curthread, curthread->tid); in _fork() [all …]
|
H A D | thr_create.c | 58 pthread_t curthread, new_thread; in _pthread_create() local 70 curthread = tls_get_curthread(); in _pthread_create() 118 THR_LOCK(curthread); in _pthread_create() 122 THR_UNLOCK(curthread); in _pthread_create() 185 THREAD_LIST_LOCK(curthread); in _pthread_create() 189 THREAD_LIST_UNLOCK(curthread); in _pthread_create() 220 tls_set_tcb(curthread->tcb); in thread_start() 225 THR_LOCK(curthread); in thread_start() 226 THR_UNLOCK(curthread); in thread_start() 229 _thr_suspend_check(curthread); in thread_start() [all …]
|
H A D | thr_mutex.c | 117 if (curthread) { in mutex_log2() 118 if (curthread->tid < 32) in mutex_log2() 353 mutex_log2(curthread, m, 1); in mutex_trylock_common() 354 m->m_owner = curthread; in mutex_trylock_common() 359 mutex_log2(curthread, m, 2); in mutex_trylock_common() 418 m->m_owner = curthread; in mutex_lock_common() 440 m->m_owner = curthread; in mutex_lock_common() 454 pthread_t curthread; in __pthread_mutex_lock() local 476 pthread_t curthread; in _pthread_mutex_lock() local 501 pthread_t curthread; in __pthread_mutex_timedlock() local [all …]
|
H A D | thr_spec.c | 49 pthread_t curthread; in _pthread_key_create() local 55 curthread = tls_get_curthread(); in _pthread_key_create() 80 pthread_t curthread = tls_get_curthread(); in _pthread_key_delete() local 108 if (curthread->specific == NULL) in _thread_cleanupspecific() 121 if (curthread->specific[key].seqno == in _thread_cleanupspecific() 123 data = curthread->specific[key].data; in _thread_cleanupspecific() 126 curthread->specific[key].data = NULL; in _thread_cleanupspecific() 127 curthread->specific_data_count--; in _thread_cleanupspecific() 135 curthread->specific[key].data = NULL; in _thread_cleanupspecific() 136 curthread->specific_data_count--; in _thread_cleanupspecific() [all …]
|
H A D | thr_cancel.c | 38 pthread_t curthread = tls_get_curthread(); in _pthread_cancel() local 63 _thr_ref_delete(curthread, pthread); in _pthread_cancel() 69 testcancel(pthread_t curthread) in testcancel() argument 73 newval = curthread->cancelflags; in testcancel() 84 oldval = curthread->cancelflags; in _pthread_setcancelstate() 94 testcancel(curthread); in _pthread_setcancelstate() 109 oldval = curthread->cancelflags; in _pthread_setcanceltype() 117 testcancel(curthread); in _pthread_setcanceltype() 136 _thr_cancel_enter(pthread_t curthread) in _thr_cancel_enter() argument 140 oldval = curthread->cancelflags; in _thr_cancel_enter() [all …]
|
H A D | thr_event.c | 47 curthread->event_buf.event = TD_CREATE; in _thr_report_creation() 49 curthread->event_buf.data = 0; in _thr_report_creation() 50 THR_UMTX_LOCK(curthread, &_thr_event_lock); in _thr_report_creation() 51 _thread_last_event = curthread; in _thr_report_creation() 54 THR_UMTX_UNLOCK(curthread, &_thr_event_lock); in _thr_report_creation() 58 _thr_report_death(pthread_t curthread) in _thr_report_death() argument 60 curthread->event_buf.event = TD_DEATH; in _thr_report_death() 61 curthread->event_buf.th_p = (td_thrhandle_t *)curthread; in _thr_report_death() 62 curthread->event_buf.data = 0; in _thr_report_death() 63 THR_UMTX_LOCK(curthread, &_thr_event_lock); in _thr_report_death() [all …]
|
H A D | thr_setschedparam.c | 47 pthread_t curthread = tls_get_curthread(); in _pthread_setschedparam() local 50 if (pthread == curthread) { in _pthread_setschedparam() 51 THR_LOCK(curthread); in _pthread_setschedparam() 54 THR_UNLOCK(curthread); in _pthread_setschedparam() 58 ret = _thr_set_sched_other_prio(curthread, in _pthread_setschedparam() 66 curthread->attr.sched_policy = policy; in _pthread_setschedparam() 69 THR_UNLOCK(curthread); in _pthread_setschedparam() 72 THR_THREAD_LOCK(curthread, pthread); in _pthread_setschedparam() 75 THR_THREAD_UNLOCK(curthread, pthread); in _pthread_setschedparam() 90 THR_THREAD_UNLOCK(curthread, pthread); in _pthread_setschedparam() [all …]
|
H A D | thr_join.c | 46 THREAD_LIST_LOCK(curthread); in backout_join() 48 THREAD_LIST_UNLOCK(curthread); in backout_join() 82 if (pthread == curthread) in join_common() 85 THREAD_LIST_LOCK(curthread); in join_common() 95 THREAD_LIST_UNLOCK(curthread); in join_common() 99 pthread->joiner = curthread; in join_common() 101 THREAD_LIST_UNLOCK(curthread); in join_common() 125 THR_CLEANUP_POP(curthread, 0); in join_common() 128 THREAD_LIST_LOCK(curthread); in join_common() 130 THREAD_LIST_UNLOCK(curthread); in join_common() [all …]
|
H A D | thr_resume_np.c | 46 pthread_t curthread = tls_get_curthread(); in _pthread_resume_np() local 50 if ((ret = _thr_ref_add(curthread, thread, /*include dead*/0)) == 0) { in _pthread_resume_np() 52 THR_THREAD_LOCK(curthread, thread); in _pthread_resume_np() 54 THR_THREAD_UNLOCK(curthread, thread); in _pthread_resume_np() 55 _thr_ref_delete(curthread, thread); in _pthread_resume_np() 63 pthread_t curthread = tls_get_curthread(); in _pthread_resume_all_np() local 67 THREAD_LIST_LOCK(curthread); in _pthread_resume_all_np() 70 if (thread != curthread) { in _pthread_resume_all_np() 71 THR_THREAD_LOCK(curthread, thread); in _pthread_resume_all_np() 73 THR_THREAD_UNLOCK(curthread, thread); in _pthread_resume_all_np() [all …]
|
H A D | thr_affinity.c | 44 pthread_t curthread = tls_get_curthread(); in _pthread_getaffinity_np() local 48 if (curthread == thread) { in _pthread_getaffinity_np() 54 if (_thr_ref_add(curthread, thread, 0) == 0) { in _pthread_getaffinity_np() 55 THR_THREAD_LOCK(curthread, thread); in _pthread_getaffinity_np() 61 THR_THREAD_UNLOCK(curthread, thread); in _pthread_getaffinity_np() 62 _thr_ref_delete(curthread, thread); in _pthread_getaffinity_np() 82 pthread_t curthread = tls_get_curthread(); in _pthread_setaffinity_np() local 92 if (curthread == thread) { in _pthread_setaffinity_np() 99 THR_THREAD_LOCK(curthread, thread); in _pthread_setaffinity_np() 105 THR_THREAD_UNLOCK(curthread, thread); in _pthread_setaffinity_np() [all …]
|
H A D | thr_info.c | 47 pthread_t curthread = tls_get_curthread(); in _pthread_setname_np() local 52 if (curthread == thread) { in _pthread_setname_np() 56 if ((error = _thr_ref_add(curthread, thread, 0)) == 0) { in _pthread_setname_np() 57 THR_THREAD_LOCK(curthread, thread); in _pthread_setname_np() 62 THR_THREAD_UNLOCK(curthread, thread); in _pthread_setname_np() 63 _thr_ref_delete(curthread, thread); in _pthread_setname_np() 81 pthread_t curthread = tls_get_curthread(); in _pthread_getname_np() local 86 if (curthread == thread) { in _pthread_getname_np() 91 THR_THREAD_LOCK(curthread, thread); in _pthread_getname_np() 98 THR_THREAD_UNLOCK(curthread, thread); in _pthread_getname_np() [all …]
|
H A D | thr_getschedparam.c | 46 pthread_t curthread = tls_get_curthread(); in _pthread_getschedparam() local 52 if (pthread == curthread) { in _pthread_getschedparam() 57 THR_LOCK(curthread); in _pthread_getschedparam() 58 *policy = curthread->attr.sched_policy; in _pthread_getschedparam() 59 param->sched_priority = curthread->attr.prio; in _pthread_getschedparam() 60 THR_UNLOCK(curthread); in _pthread_getschedparam() 63 else if ((ret = _thr_ref_add(curthread, pthread, /*include dead*/0)) in _pthread_getschedparam() 65 THR_THREAD_LOCK(curthread, pthread); in _pthread_getschedparam() 68 THR_THREAD_UNLOCK(curthread, pthread); in _pthread_getschedparam() 69 _thr_ref_delete(curthread, pthread); in _pthread_getschedparam()
|
H A D | thr_cond.c | 157 pthread_t curthread = tls_get_curthread(); in _pthread_cond_destroy() local 180 THR_LOCK_RELEASE(curthread, &cv->c_lock); in _pthread_cond_destroy() 206 pthread_t curthread = tls_get_curthread(); in cond_cancel_handler() local 211 THR_LOCK_ACQUIRE(curthread, &cv->c_lock); in cond_cancel_handler() 220 THR_LOCK_RELEASE(curthread, &cv->c_lock); in cond_cancel_handler() 234 pthread_t curthread = tls_get_curthread(); in cond_wait_common() local 254 THR_LOCK_ACQUIRE(curthread, &cv->c_lock); in cond_wait_common() 289 THR_CLEANUP_POP(curthread, 0); in cond_wait_common() 311 THR_LOCK_RELEASE(curthread, &cv->c_lock); in cond_wait_common() 382 THR_LOCK_ACQUIRE(curthread, &cv->c_lock); in cond_signal_common() [all …]
|
H A D | thr_spinlock.c | 65 pthread_t curthread = tls_get_curthread(); in _spinunlock() local 67 THR_UMTX_UNLOCK(curthread, (volatile umtx_t *)&lck->access_lock); in _spinunlock() 73 pthread_t curthread; in _spinlock() local 82 curthread = tls_get_curthread(); in _spinlock() 83 THR_UMTX_LOCK(curthread, (volatile umtx_t *)&lck->access_lock); in _spinlock() 92 pthread_t curthread; in _spintrylock() local 101 curthread = tls_get_curthread(); in _spintrylock() 102 return(THR_UMTX_TRYLOCK(curthread, in _spintrylock() 116 pthread_t curthread = tls_get_curthread(); in init_spinlock() local 118 THR_UMTX_LOCK(curthread, &spinlock_static_lock); in init_spinlock() [all …]
|
H A D | thr_kern.c | 69 _thr_signal_block(pthread_t curthread) in _thr_signal_block() argument 73 if (curthread->sigblock > 0) { in _thr_signal_block() 74 curthread->sigblock++; in _thr_signal_block() 83 __sys_sigprocmask(SIG_BLOCK, &set, &curthread->sigmask); in _thr_signal_block() 84 curthread->sigblock++; in _thr_signal_block() 88 _thr_signal_unblock(pthread_t curthread) in _thr_signal_unblock() argument 90 if (--curthread->sigblock == 0) in _thr_signal_unblock() 198 pthread_t curthread = tls_get_curthread(); in _thr_getscheduler() local 202 if (lwpid == curthread->tid) in _thr_getscheduler() 214 pthread_t curthread = tls_get_curthread(); in _thr_setscheduler() local [all …]
|
H A D | thr_rwlock.c | 184 pthread_t curthread = tls_get_curthread(); in rwlock_rdlock_common() local 215 curthread = tls_get_curthread(); in rwlock_rdlock_common() 257 curthread->rdlock_count++; in rwlock_rdlock_common() 288 pthread_t curthread = tls_get_curthread(); in _pthread_rwlock_tryrdlock() local 309 curthread = tls_get_curthread(); in _pthread_rwlock_tryrdlock() 314 curthread->rdlock_count++; in _pthread_rwlock_tryrdlock() 321 curthread->rdlock_count++; in _pthread_rwlock_tryrdlock() 334 pthread_t curthread = tls_get_curthread(); in _pthread_rwlock_trywrlock() local 370 pthread_t curthread; in _pthread_rwlock_unlock() local 388 curthread = tls_get_curthread(); in _pthread_rwlock_unlock() [all …]
|
H A D | thr_detach.c | 39 pthread_t curthread = tls_get_curthread(); in _pthread_detach() local 45 THREAD_LIST_LOCK(curthread); in _pthread_detach() 46 if ((rval = _thr_find_thread(curthread, pthread, in _pthread_detach() 48 THREAD_LIST_UNLOCK(curthread); in _pthread_detach() 55 THREAD_LIST_UNLOCK(curthread); in _pthread_detach() 63 THREAD_LIST_UNLOCK(curthread); in _pthread_detach()
|
/dragonfly/sys/platform/pc64/x86_64/ |
H A D | uwrapper.c | 17 return curthread->td_proc->p_vmspace->vm_pmap.copyin(udaddr, kaddr, len); in copyin() 30 return curthread->td_proc->p_vmspace->vm_pmap.fubyte(base); in fubyte() 36 return curthread->td_proc->p_vmspace->vm_pmap.subyte(base, byte); in subyte() 42 return curthread->td_proc->p_vmspace->vm_pmap.fuword32(base); in fuword32() 48 return curthread->td_proc->p_vmspace->vm_pmap.fuword64(base); in fuword64() 54 return curthread->td_proc->p_vmspace->vm_pmap.suword64(base, word); in suword64() 60 return curthread->td_proc->p_vmspace->vm_pmap.suword32(base, word); in suword32() 66 return curthread->td_proc->p_vmspace->vm_pmap.swapu32(base, v); in swapu32() 72 return curthread->td_proc->p_vmspace->vm_pmap.swapu64(base, v); in swapu64() 78 return curthread->td_proc->p_vmspace->vm_pmap.fuwordadd32(base, v); in fuwordadd32() [all …]
|
H A D | support.s | 200 movq PCPU(curthread),%rcx 211 movq PCPU(curthread),%rcx 230 movq PCPU(curthread),%rax 266 movq PCPU(curthread),%rdx 274 movq PCPU(curthread),%rdx 292 movq PCPU(curthread),%rax 315 movq PCPU(curthread),%rdx 323 movq PCPU(curthread),%rdx 336 movq PCPU(curthread),%rcx 355 movq PCPU(curthread),%rcx [all …]
|
/dragonfly/lib/libc/stdio/ |
H A D | _flock_stub.c | 52 pthread_t curthread = _pthread_self(); in _flockfile() local 54 if (fp->_fl_owner == curthread) in _flockfile() 62 fp->_fl_owner = curthread; in _flockfile() 79 pthread_t curthread = _pthread_self(); in _ftrylockfile() local 82 if (fp->_fl_owner == curthread) in _ftrylockfile() 89 fp->_fl_owner = curthread; in _ftrylockfile() 100 pthread_t curthread = _pthread_self(); in _funlockfile() local 105 if (fp->_fl_owner == curthread) { in _funlockfile()
|