Lines Matching defs:curthread

74 static void thr_destroy(struct pthread *curthread, struct pthread *thread);
96 _thr_gc(struct pthread *curthread)
102 THREAD_LIST_WRLOCK(curthread);
114 THREAD_LIST_UNLOCK(curthread);
127 _thr_free(curthread, td);
132 _thr_alloc(struct pthread *curthread)
137 if (curthread != NULL) {
139 _thr_gc(curthread);
141 THR_LOCK_ACQUIRE(curthread, &free_thread_lock);
146 THR_LOCK_RELEASE(curthread, &free_thread_lock);
160 thr_destroy(curthread, thread);
168 if (curthread != NULL) {
169 THR_LOCK_ACQUIRE(curthread, &tcb_lock);
171 THR_LOCK_RELEASE(curthread, &tcb_lock);
178 thr_destroy(curthread, thread);
186 _thr_free(struct pthread *curthread, struct pthread *thread)
195 if (curthread != NULL) {
196 THR_LOCK_ACQUIRE(curthread, &tcb_lock);
198 THR_LOCK_RELEASE(curthread, &tcb_lock);
203 if ((curthread == NULL) || (free_thread_count >= MAX_CACHED_THREADS)) {
204 thr_destroy(curthread, thread);
211 THR_LOCK_ACQUIRE(curthread, &free_thread_lock);
214 THR_LOCK_RELEASE(curthread, &free_thread_lock);
219 thr_destroy(struct pthread *curthread __unused, struct pthread *thread)
233 _thr_link(struct pthread *curthread, struct pthread *thread)
235 THREAD_LIST_WRLOCK(curthread);
237 THREAD_LIST_UNLOCK(curthread);
245 _thr_unlink(struct pthread *curthread, struct pthread *thread)
247 THREAD_LIST_WRLOCK(curthread);
249 THREAD_LIST_UNLOCK(curthread);
288 _thr_ref_add(struct pthread *curthread, struct pthread *thread,
297 if ((ret = _thr_find_thread(curthread, thread, include_dead)) == 0) {
299 THR_CRITICAL_ENTER(curthread);
300 THR_THREAD_UNLOCK(curthread, thread);
308 _thr_ref_delete(struct pthread *curthread, struct pthread *thread)
310 THR_THREAD_LOCK(curthread, thread);
312 _thr_try_gc(curthread, thread);
313 THR_CRITICAL_LEAVE(curthread);
318 _thr_try_gc(struct pthread *curthread, struct pthread *thread)
321 THR_REF_ADD(curthread, thread);
322 THR_THREAD_UNLOCK(curthread, thread);
323 THREAD_LIST_WRLOCK(curthread);
324 THR_THREAD_LOCK(curthread, thread);
325 THR_REF_DEL(curthread, thread);
330 THR_THREAD_UNLOCK(curthread, thread);
331 THREAD_LIST_UNLOCK(curthread);
333 THR_THREAD_UNLOCK(curthread, thread);
339 _thr_find_thread(struct pthread *curthread, struct pthread *thread,
349 THREAD_LIST_RDLOCK(curthread);
352 THR_THREAD_LOCK(curthread, pthread);
354 THR_THREAD_UNLOCK(curthread, pthread);
360 THREAD_LIST_UNLOCK(curthread);
379 struct pthread *curthread, *thrd;
387 curthread = _get_curthread();
388 THREAD_LIST_RDLOCK(curthread);
393 THREAD_LIST_UNLOCK(curthread);