Lines Matching refs:thr

104     nxt_thread_t        *thr;  in nxt_thread_trampoline()  local
110 thr = nxt_thread_init(); in nxt_thread_trampoline()
112 nxt_log_debug(thr->log, "thread trampoline: %PH", thr->handle); in nxt_thread_trampoline()
114 pthread_cleanup_push(nxt_thread_time_cleanup, thr); in nxt_thread_trampoline()
120 thr->link = link; in nxt_thread_trampoline()
135 nxt_thread_exit(thr); in nxt_thread_trampoline()
144 nxt_thread_t *thr; in nxt_thread_init() local
148 thr = nxt_thread(); in nxt_thread_init()
150 if (thr->log == NULL) { in nxt_thread_init()
151 thr->log = &nxt_main_log; in nxt_thread_init()
152 thr->handle = nxt_thread_handle(); in nxt_thread_init()
158 thr->time.signal = -1; in nxt_thread_init()
160 nxt_thread_time_update(thr); in nxt_thread_init()
163 nxt_random_init(&thr->random); in nxt_thread_init()
165 return thr; in nxt_thread_init()
172 nxt_thread_t *thr; in nxt_thread_time_cleanup() local
174 thr = data; in nxt_thread_time_cleanup()
176 nxt_log_debug(thr->log, "thread time cleanup"); in nxt_thread_time_cleanup()
178 nxt_thread_time_free(thr); in nxt_thread_time_cleanup()
183 nxt_thread_exit(nxt_thread_t *thr) in nxt_thread_exit() argument
188 nxt_log_debug(thr->log, "thread exit"); in nxt_thread_exit()
190 link = thr->link; in nxt_thread_exit()
191 thr->link = NULL; in nxt_thread_exit()
199 link->work.obj = (void *) (uintptr_t) thr->handle; in nxt_thread_exit()
205 nxt_thread_time_free(thr); in nxt_thread_exit()
243 nxt_thread_tid(nxt_thread_t *thr) in nxt_thread_tid() argument
247 if (nxt_slow_path(thr->tid == 0)) { in nxt_thread_tid()
248 thr->tid = nxt_thread_get_tid(); in nxt_thread_tid()
251 return thr->tid; in nxt_thread_tid()
255 if (nxt_fast_path(thr != NULL)) { in nxt_thread_tid()
257 if (nxt_slow_path(thr->tid == 0)) { in nxt_thread_tid()
258 thr->tid = nxt_thread_get_tid(); in nxt_thread_tid()
261 return thr->tid; in nxt_thread_tid()