Lines Matching refs:curthread

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