Home
last modified time | relevance | path

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

12

/mirbsd/src/lib/libpthread/uthread/
Duthread_kern.c69 struct pthread *curthread = _get_curthread(); in _thread_kern_sched() local
97 memcpy(&curthread->saved_sigcontext, scp, in _thread_kern_sched()
98 sizeof(curthread->saved_sigcontext)); in _thread_kern_sched()
101 curthread->sig_saved = 1; in _thread_kern_sched()
104 curthread->sig_saved = 0; in _thread_kern_sched()
107 if ((curthread->flags & PTHREAD_FLAGS_PRIVATE) == 0) in _thread_kern_sched()
108 _last_user_thread = curthread; in _thread_kern_sched()
111 _thread_machdep_save_float_state(&curthread->_machdep); in _thread_kern_sched()
114 curthread->error = errno; in _thread_kern_sched()
117 old_thread_run = curthread; in _thread_kern_sched()
[all …]
Duthread_mutex.c269 struct pthread *curthread = _get_curthread(); in mutex_trylock_common() local
301 (*mutex)->m_owner = curthread; in mutex_trylock_common()
305 TAILQ_INSERT_TAIL(&curthread->mutexq, in mutex_trylock_common()
307 } else if ((*mutex)->m_owner == curthread) in mutex_trylock_common()
319 (*mutex)->m_owner = curthread; in mutex_trylock_common()
322 curthread->priority_mutex_count++; in mutex_trylock_common()
328 (*mutex)->m_prio = curthread->active_priority; in mutex_trylock_common()
330 curthread->inherited_priority; in mutex_trylock_common()
334 TAILQ_INSERT_TAIL(&curthread->mutexq, in mutex_trylock_common()
336 } else if ((*mutex)->m_owner == curthread) in mutex_trylock_common()
[all …]
Duthread_cancel.c130 struct pthread *curthread = _get_curthread(); in pthread_setcancelstate() local
134 ostate = curthread->cancelflags & PTHREAD_CANCEL_DISABLE; in pthread_setcancelstate()
140 curthread->cancelflags &= ~PTHREAD_CANCEL_DISABLE; in pthread_setcancelstate()
141 if ((curthread->cancelflags & PTHREAD_CANCEL_ASYNCHRONOUS) != 0) in pthread_setcancelstate()
148 curthread->cancelflags |= PTHREAD_CANCEL_DISABLE; in pthread_setcancelstate()
162 struct pthread *curthread = _get_curthread(); in pthread_setcanceltype() local
166 otype = curthread->cancelflags & PTHREAD_CANCEL_ASYNCHRONOUS; in pthread_setcanceltype()
171 curthread->cancelflags |= PTHREAD_CANCEL_ASYNCHRONOUS; in pthread_setcanceltype()
178 curthread->cancelflags &= ~PTHREAD_CANCEL_ASYNCHRONOUS; in pthread_setcanceltype()
191 struct pthread *curthread = _get_curthread(); in pthread_testcancel() local
[all …]
Duthread_sig.c66 struct pthread *curthread = _get_curthread(); in _thread_sig_handler() local
77 if (curthread->sig_defer_count > 0) { in _thread_sig_handler()
83 curthread->yield_on_sig_undefer = 1; in _thread_sig_handler()
120 (curthread->sig_defer_count > 0))) { in _thread_sig_handler()
172 struct pthread *curthread = _get_curthread(); in _thread_sig_handle() local
199 _thread_clear_pending(sig, curthread); in _thread_sig_handle()
209 _thread_clear_pending(SIGCONT, curthread); in _thread_sig_handle()
211 _thread_clear_pending(SIGSTOP, curthread); in _thread_sig_handle()
212 _thread_clear_pending(SIGTSTP, curthread); in _thread_sig_handle()
213 _thread_clear_pending(SIGTTIN, curthread); in _thread_sig_handle()
[all …]
Duthread_exit.c149 struct pthread *curthread = _get_curthread(); in pthread_exit() local
153 if ((curthread->flags & PTHREAD_EXITING) != 0) { in pthread_exit()
158 curthread->flags |= PTHREAD_EXITING; in pthread_exit()
161 curthread->ret = status; in pthread_exit()
163 while (curthread->cleanup != NULL) { in pthread_exit()
166 if (curthread->attr.cleanup_attr != NULL) { in pthread_exit()
167 curthread->attr.cleanup_attr(curthread->attr.arg_attr); in pthread_exit()
170 if (curthread->specific_data != NULL) { in pthread_exit()
183 TAILQ_INSERT_HEAD(&_dead_list, curthread, dle); in pthread_exit()
204 if (curthread->joiner != NULL) { in pthread_exit()
[all …]
Duthread_cond.c163 struct pthread *curthread = _get_curthread(); in pthread_cond_wait() local
224 curthread->timeout = 0; in pthread_cond_wait()
225 curthread->interrupted = 0; in pthread_cond_wait()
231 cond_queue_enq(*cond, curthread); in pthread_cond_wait()
238 curthread->wakeup_time.tv_sec = -1; in pthread_cond_wait()
247 cond_queue_remove(*cond, curthread); in pthread_cond_wait()
266 interrupted = curthread->interrupted; in pthread_cond_wait()
291 curthread); in pthread_cond_wait()
316 if ((interrupted != 0) && (curthread->continuation != NULL)) in pthread_cond_wait()
317 curthread->continuation((void *) curthread); in pthread_cond_wait()
[all …]
Duthread_kevent.c44 struct pthread *curthread = _get_curthread(); in kevent() local
56 curthread->data.fd.fd = kq; in kevent()
57 curthread->data.fd.fname = __FILE__; in kevent()
58 curthread->data.fd.branch = __LINE__; in kevent()
62 curthread->interrupted = 0; in kevent()
63 curthread->timeout = 0; in kevent()
68 if (curthread->interrupted) { in kevent()
75 } while (rc == 0 && curthread->timeout == 0); in kevent()
Duthread_sigmask.c44 struct pthread *curthread = _get_curthread(); in pthread_sigmask() local
51 *oset = curthread->sigmask; in pthread_sigmask()
60 curthread->sigmask |= *set; in pthread_sigmask()
66 curthread->sigmask &= ~(*set); in pthread_sigmask()
72 curthread->sigmask = *set; in pthread_sigmask()
87 sigset = curthread->sigpend; in pthread_sigmask()
89 sigset &= ~curthread->sigmask; in pthread_sigmask()
Duthread_spec.c92 struct pthread *curthread = _get_curthread(); in _thread_cleanupspecific() local
100 if (curthread->specific_data_count) { in _thread_cleanupspecific()
106 if (curthread->specific_data[key]) { in _thread_cleanupspecific()
107 data = (void *) curthread->specific_data[key]; in _thread_cleanupspecific()
108 curthread->specific_data[key] = NULL; in _thread_cleanupspecific()
109 curthread->specific_data_count--; in _thread_cleanupspecific()
124 free(curthread->specific_data); in _thread_cleanupspecific()
125 curthread->specific_data = NULL; in _thread_cleanupspecific()
130 free(curthread->specific_data); in _thread_cleanupspecific()
131 curthread->specific_data = NULL; in _thread_cleanupspecific()
Duthread_spinlock.c54 struct pthread *curthread = _get_curthread(); in _spinlock() local
62 curthread->data.spinlock = lck; in _spinlock()
67 lck->lock_owner = curthread; in _spinlock()
83 struct pthread *curthread = _get_curthread(); in _spinlock_debug() local
94 …ed to lock %p from %s (%d) was left locked from %s (%d)\n", __progname, curthread, lck, fname, lin… in _spinlock_debug()
101 curthread->data.spinlock = lck; in _spinlock_debug()
106 lck->lock_owner = curthread; in _spinlock_debug()
Duthread_nanosleep.c45 struct pthread *curthread = _get_curthread(); in nanosleep() local
71 curthread->wakeup_time.tv_sec = current_time.tv_sec + time_to_sleep->tv_sec; in nanosleep()
72 curthread->wakeup_time.tv_nsec = current_time.tv_nsec + time_to_sleep->tv_nsec; in nanosleep()
75 if (curthread->wakeup_time.tv_nsec >= 1000000000) { in nanosleep()
77 curthread->wakeup_time.tv_sec += 1; in nanosleep()
78 curthread->wakeup_time.tv_nsec -= 1000000000; in nanosleep()
80 curthread->interrupted = 0; in nanosleep()
126 if (curthread->interrupted) { in nanosleep()
Duthread_rwlock.c133 struct pthread *curthread; in pthread_rwlock_rdlock() local
159 curthread = _get_curthread(); in pthread_rwlock_rdlock()
160 if ((curthread->rdlock_count > 0) && (prwlock->state > 0)) { in pthread_rwlock_rdlock()
188 curthread->rdlock_count++; in pthread_rwlock_rdlock()
206 struct pthread *curthread; in pthread_rwlock_tryrdlock() local
226 curthread = _get_curthread(); in pthread_rwlock_tryrdlock()
229 else if ((curthread->rdlock_count > 0) && (prwlock->state > 0)) { in pthread_rwlock_tryrdlock()
231 curthread->rdlock_count++; in pthread_rwlock_tryrdlock()
239 curthread->rdlock_count++; in pthread_rwlock_tryrdlock()
287 struct pthread *curthread; in pthread_rwlock_unlock() local
[all …]
Duthread_join.c43 struct pthread *curthread = _get_curthread(); in pthread_join() local
57 if (pthread == curthread) { in pthread_join()
116 pthread->joiner = curthread; in pthread_join()
119 curthread->join_status.thread = pthread; in pthread_join()
121 while (curthread->join_status.thread == pthread) { in pthread_join()
130 ret = curthread->join_status.error; in pthread_join()
132 *thread_return = curthread->join_status.ret; in pthread_join()
Duthread_clean.c45 struct pthread *curthread = _get_curthread(); in pthread_cleanup_push() local
51 new->next = curthread->cleanup; in pthread_cleanup_push()
53 curthread->cleanup = new; in pthread_cleanup_push()
60 struct pthread *curthread = _get_curthread(); in pthread_cleanup_pop() local
63 if ((old = curthread->cleanup) != NULL) { in pthread_cleanup_pop()
64 curthread->cleanup = old->next; in pthread_cleanup_pop()
Duthread_select.c57 struct pthread *curthread = _get_curthread(); in select() local
107 if ((curthread->poll_data.fds == NULL) || in select()
108 (curthread->poll_data.nfds < fd_count)) { in select()
109 data.fds = (struct pollfd *) realloc(curthread->poll_data.fds, in select()
121 curthread->poll_data.fds = data.fds; in select()
122 curthread->poll_data.nfds = MAX(POLLDATA_MIN, fd_count); in select()
127 data.fds = curthread->poll_data.fds; in select()
166 curthread->data.poll_data = &data; in select()
167 curthread->interrupted = 0; in select()
169 if (curthread->interrupted) { in select()
Duthread_accept.c47 struct pthread *curthread = _get_curthread(); in accept() local
61 curthread->data.fd.fd = fd; in accept()
62 curthread->data.fd.fname = __FILE__; in accept()
63 curthread->data.fd.branch = __LINE__; in accept()
67 curthread->interrupted = 0; in accept()
74 if (curthread->interrupted) { in accept()
Duthread_create.c57 struct pthread *curthread = _get_curthread(); in pthread_create() local
122 new_thread->sigmask = curthread->sigmask; in pthread_create()
142 curthread->base_priority & in pthread_create()
145 curthread->base_priority & in pthread_create()
148 curthread->attr.sched_policy; in pthread_create()
238 struct pthread *curthread = _get_curthread(); in _thread_start() local
244 pthread_exit(curthread->start_routine(curthread->arg)); in _thread_start()
Duthread_sigaltstack.c30 struct pthread *curthread = _get_curthread(); in sigaltstack() local
41 if (curthread == NULL || curthread->stack == NULL) in sigaltstack()
44 oss->ss_sp = curthread->stack->base; in sigaltstack()
45 oss->ss_size = curthread->stack->size; in sigaltstack()
Duthread_sigwait.c44 struct pthread *curthread = _get_curthread(); in sigwait() local
74 tempset = curthread->sigpend; in sigwait()
85 _thread_clear_pending(i, curthread); in sigwait()
132 curthread->data.sigwait = &waitset; in sigwait()
138 *sig = curthread->signo; in sigwait()
144 curthread->data.sigwait = NULL; in sigwait()
Duthread_fd.c397 struct pthread *curthread = _get_curthread(); in _thread_fd_unlock() local
398 _thread_fd_unlock_thread(curthread, fd, lock_type); in _thread_fd_unlock()
438 struct pthread *curthread = _get_curthread(); in _thread_fd_lock() local
462 while (entry->r_owner != curthread) { in _thread_fd_lock()
475 curthread, qe); in _thread_fd_lock()
482 curthread->data.fd.fd = fd; in _thread_fd_lock()
516 entry->r_owner = curthread; in _thread_fd_lock()
536 while (entry->w_owner != curthread) { in _thread_fd_lock()
550 curthread, qe); in _thread_fd_lock()
557 curthread->data.fd.fd = fd; in _thread_fd_lock()
[all …]
Duthread_yield.c42 struct pthread *curthread = _get_curthread(); in sched_yield() local
45 curthread->slice_usec = -1; in sched_yield()
58 struct pthread *curthread = _get_curthread(); in pthread_yield() local
61 curthread->slice_usec = -1; in pthread_yield()
Duthread_sigsuspend.c44 struct pthread *curthread = _get_curthread(); in sigsuspend() local
53 oset = curthread->sigmask; in sigsuspend()
56 curthread->sigmask = *set; in sigsuspend()
65 curthread->sigmask = oset; in sigsuspend()
Duthread_sendmsg.c46 struct pthread *curthread = _get_curthread(); in sendmsg() local
55 curthread->data.fd.fd = fd; in sendmsg()
59 curthread->interrupted = 0; in sendmsg()
63 if (curthread->interrupted) { in sendmsg()
Duthread_recvmsg.c46 struct pthread *curthread = _get_curthread(); in recvmsg() local
55 curthread->data.fd.fd = fd; in recvmsg()
59 curthread->interrupted = 0; in recvmsg()
63 if (curthread->interrupted) { in recvmsg()
Duthread_gc.c51 struct pthread *curthread = _get_curthread(); in _thread_gc() local
66 curthread->flags |= PTHREAD_FLAGS_PRIVATE; in _thread_gc()
72 pthread_set_name_np(curthread, (char *)"GC"); in _thread_gc()
87 if (TAILQ_FIRST(&_thread_list) == curthread && in _thread_gc()
88 TAILQ_NEXT(curthread, tle) == NULL) in _thread_gc()

12