Lines Matching refs:thread
49 _pthread_suspend_np(pthread_t thread) in _pthread_suspend_np() argument
55 if (thread == _get_curthread()) in _pthread_suspend_np()
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()
108 struct pthread *thread; in _thr_suspend_all_np() local
116 TAILQ_FOREACH(thread, &_thread_list, tle) { in _thr_suspend_all_np()
117 if (thread != curthread) { in _thr_suspend_all_np()
118 THR_THREAD_LOCK(curthread, thread); in _thr_suspend_all_np()
119 if (thread->state != PS_DEAD && in _thr_suspend_all_np()
120 !(thread->flags & THR_FLAGS_SUSPENDED)) in _thr_suspend_all_np()
121 thread->flags |= THR_FLAGS_NEED_SUSPEND; in _thr_suspend_all_np()
122 THR_THREAD_UNLOCK(curthread, thread); in _thr_suspend_all_np()
128 TAILQ_FOREACH(thread, &_thread_list, tle) { in _thr_suspend_all_np()
129 if (thread != curthread) { in _thr_suspend_all_np()
131 THR_THREAD_LOCK(curthread, thread); in _thr_suspend_all_np()
132 ret = suspend_common(curthread, thread, 0); in _thr_suspend_all_np()
136 THR_REF_ADD(curthread, thread); in _thr_suspend_all_np()
137 suspend_common(curthread, thread, 1); in _thr_suspend_all_np()
138 THR_REF_DEL(curthread, thread); in _thr_suspend_all_np()
139 _thr_try_gc(curthread, thread); in _thr_suspend_all_np()
150 THR_THREAD_UNLOCK(curthread, thread); in _thr_suspend_all_np()
160 suspend_common(struct pthread *curthread, struct pthread *thread, in suspend_common() argument
165 while (thread->state != PS_DEAD && in suspend_common()
166 !(thread->flags & THR_FLAGS_SUSPENDED)) { in suspend_common()
167 thread->flags |= THR_FLAGS_NEED_SUSPEND; in suspend_common()
169 if (thread->tid == TID_TERMINATED) in suspend_common()
171 tmp = thread->cycle; in suspend_common()
172 _thr_send_sig(thread, SIGCANCEL); in suspend_common()
173 THR_THREAD_UNLOCK(curthread, thread); in suspend_common()
175 _thr_umtx_wait_uint(&thread->cycle, tmp, NULL, 0); in suspend_common()
176 THR_THREAD_LOCK(curthread, thread); in suspend_common()
178 THR_THREAD_LOCK(curthread, thread); in suspend_common()