Lines Matching refs:curthread
83 static void thr_destroy(pthread_t curthread, pthread_t thread);
104 _thr_gc(pthread_t curthread) in _thr_gc() argument
110 THREAD_LIST_LOCK(curthread); in _thr_gc()
132 THREAD_LIST_UNLOCK(curthread); in _thr_gc()
145 _thr_free(curthread, td); in _thr_gc()
150 _thr_alloc(pthread_t curthread) in _thr_alloc() argument
155 if (curthread != NULL) { in _thr_alloc()
157 _thr_gc(curthread); in _thr_alloc()
159 THR_LOCK_ACQUIRE(curthread, &free_thread_lock); in _thr_alloc()
164 THR_LOCK_RELEASE(curthread, &free_thread_lock); in _thr_alloc()
172 if (curthread != NULL) { in _thr_alloc()
173 THR_LOCK_ACQUIRE(curthread, &tcb_lock); in _thr_alloc()
175 THR_LOCK_RELEASE(curthread, &tcb_lock); in _thr_alloc()
183 thr_destroy(curthread, thread); in _thr_alloc()
190 _thr_free(pthread_t curthread, pthread_t thread) in _thr_free() argument
202 if (curthread != NULL) { in _thr_free()
203 THR_LOCK_ACQUIRE(curthread, &tcb_lock); in _thr_free()
205 THR_LOCK_RELEASE(curthread, &tcb_lock); in _thr_free()
210 if ((curthread == NULL) || (free_thread_count >= MAX_CACHED_THREADS)) { in _thr_free()
211 thr_destroy(curthread, thread); in _thr_free()
217 THR_LOCK_ACQUIRE(curthread, &free_thread_lock); in _thr_free()
220 THR_LOCK_RELEASE(curthread, &free_thread_lock); in _thr_free()
225 thr_destroy(pthread_t curthread __unused, pthread_t thread) in thr_destroy()
239 _thr_link(pthread_t curthread, pthread_t thread) in _thr_link() argument
241 THREAD_LIST_LOCK(curthread); in _thr_link()
250 THREAD_LIST_UNLOCK(curthread); in _thr_link()
257 _thr_unlink(pthread_t curthread, pthread_t thread) in _thr_unlink() argument
259 THREAD_LIST_LOCK(curthread); in _thr_unlink()
262 THREAD_LIST_UNLOCK(curthread); in _thr_unlink()
300 _thr_ref_add(pthread_t curthread, pthread_t thread, in _thr_ref_add() argument
309 THREAD_LIST_LOCK(curthread); in _thr_ref_add()
310 if ((ret = _thr_find_thread(curthread, thread, include_dead)) == 0) { in _thr_ref_add()
313 THREAD_LIST_UNLOCK(curthread); in _thr_ref_add()
320 _thr_ref_delete(pthread_t curthread, pthread_t thread) in _thr_ref_delete() argument
322 THREAD_LIST_LOCK(curthread); in _thr_ref_delete()
323 _thr_ref_delete_unlocked(curthread, thread); in _thr_ref_delete()
324 THREAD_LIST_UNLOCK(curthread); in _thr_ref_delete()
328 _thr_ref_delete_unlocked(pthread_t curthread __unused, pthread_t thread) in _thr_ref_delete_unlocked()
339 _thr_find_thread(pthread_t curthread __unused, pthread_t thread, in _thr_find_thread()