Lines Matching refs:ti

167 thread_info_free(thread_info_t *ti)  in thread_info_free()  argument
169 uu_list_node_fini(ti, &ti->ti_node, thread_pool); in thread_info_free()
170 if (ti->ti_ucred != NULL) in thread_info_free()
171 uu_free(ti->ti_ucred); in thread_info_free()
172 uu_free(ti); in thread_info_free()
178 thread_info_t *ti = arg; in thread_exiting() local
180 if (ti != NULL) in thread_exiting()
181 log_enter(&ti->ti_log); in thread_exiting()
184 if (ti != NULL) { in thread_exiting()
186 uu_list_remove(thread_list, ti); in thread_exiting()
197 if (ti != NULL && ti != &main_thread_info) in thread_exiting()
198 thread_info_free(ti); in thread_exiting()
202 thread_newstate(thread_info_t *ti, thread_state_t newstate) in thread_newstate() argument
204 ti->ti_ucred_read = 0; /* invalidate cached ucred */ in thread_newstate()
205 if (newstate != ti->ti_state) { in thread_newstate()
206 ti->ti_prev_state = ti->ti_state; in thread_newstate()
207 ti->ti_state = newstate; in thread_newstate()
208 ti->ti_lastchange = gethrtime(); in thread_newstate()
225 thread_info_t *ti = thread_self(); in get_ucred() local
226 ucred_t **ret = &ti->ti_ucred; in get_ucred()
228 if (ti->ti_ucred_read) in get_ucred()
233 ti->ti_ucred_read = 1; in get_ucred()
265 thread_info_t *ti = thread_self(); in get_audit_session() local
267 return (ti->ti_active_client->rc_adt_session); in get_audit_session()
273 thread_info_t *ti = arg; in thread_start() local
280 ti); in thread_start()
282 (void) pthread_setspecific(thread_info_key, ti); in thread_start()
284 thread_newstate(ti, TI_DOOR_RETURN); in thread_start()
296 thread_info_t *ti; in new_thread_needed() local
305 if ((ti = uu_zalloc(sizeof (*ti))) == NULL) in new_thread_needed()
308 uu_list_node_init(ti, &ti->ti_node, thread_pool); in new_thread_needed()
309 ti->ti_state = TI_CREATED; in new_thread_needed()
310 ti->ti_prev_state = TI_CREATED; in new_thread_needed()
312 if ((ti->ti_ucred = uu_zalloc(ucred_size())) == NULL) in new_thread_needed()
317 if ((errno = pthread_create(&ti->ti_thread, &thread_attr, thread_start, in new_thread_needed()
318 ti)) != 0) { in new_thread_needed()
332 if (ti != NULL) in new_thread_needed()
333 thread_info_free(ti); in new_thread_needed()
546 thread_info_t *ti = &main_thread_info; in main() local
753 (void) memset(ti, '\0', sizeof (*ti)); in main()
754 uu_list_node_init(ti, &ti->ti_node, thread_pool); in main()
756 ti); in main()
758 ti->ti_thread = pthread_self(); in main()
759 ti->ti_state = TI_SIGNAL_WAIT; in main()
760 ti->ti_prev_state = TI_SIGNAL_WAIT; in main()
762 (void) pthread_setspecific(thread_info_key, ti); in main()