Lines Matching refs:thread

43 _pthread_suspend_np(pthread_t thread)  in _pthread_suspend_np()  argument
49 if (thread == curthread) in _pthread_suspend_np()
53 else if ((ret = _thr_ref_add(curthread, thread, /*include dead*/0)) in _pthread_suspend_np()
56 THR_THREAD_LOCK(curthread, thread); in _pthread_suspend_np()
57 suspend_common(curthread, thread, 1); in _pthread_suspend_np()
59 THR_THREAD_UNLOCK(curthread, thread); in _pthread_suspend_np()
62 _thr_ref_delete(curthread, thread); in _pthread_suspend_np()
71 pthread_t thread; in _pthread_suspend_all_np() local
76 TAILQ_FOREACH(thread, &_thread_list, tle) { 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()
79 if (thread->state != PS_DEAD && in _pthread_suspend_all_np()
80 !(thread->flags & THR_FLAGS_SUSPENDED)) in _pthread_suspend_all_np()
81 thread->flags |= THR_FLAGS_NEED_SUSPEND; in _pthread_suspend_all_np()
82 THR_THREAD_UNLOCK(curthread, thread); in _pthread_suspend_all_np()
88 TAILQ_FOREACH(thread, &_thread_list, tle) { 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()
92 ret = suspend_common(curthread, thread, 0); in _pthread_suspend_all_np()
95 thread->refcount++; in _pthread_suspend_all_np()
97 suspend_common(curthread, thread, 1); in _pthread_suspend_all_np()
98 THR_THREAD_UNLOCK(curthread, thread); in _pthread_suspend_all_np()
100 _thr_ref_delete_unlocked(curthread, thread); in _pthread_suspend_all_np()
108 THR_THREAD_UNLOCK(curthread, thread); in _pthread_suspend_all_np()
116 suspend_common(pthread_t curthread, pthread_t thread, int waitok) in suspend_common() argument
120 while (thread->state != PS_DEAD && in suspend_common()
121 !(thread->flags & THR_FLAGS_SUSPENDED)) { in suspend_common()
122 thread->flags |= THR_FLAGS_NEED_SUSPEND; in suspend_common()
123 tmp = thread->cycle; in suspend_common()
124 _thr_send_sig(thread, SIGCANCEL); in suspend_common()
125 THR_THREAD_UNLOCK(curthread, thread); in suspend_common()
127 _thr_umtx_wait(&thread->cycle, tmp, NULL, 0); in suspend_common()
128 THR_THREAD_LOCK(curthread, thread); in suspend_common()
130 THR_THREAD_LOCK(curthread, thread); in suspend_common()