Lines Matching refs:ti

168 thread_info_free(thread_info_t *ti)  in thread_info_free()  argument
170 uu_list_node_fini(ti, &ti->ti_node, thread_pool); in thread_info_free()
171 if (ti->ti_ucred != NULL) in thread_info_free()
172 uu_free(ti->ti_ucred); in thread_info_free()
173 uu_free(ti); in thread_info_free()
179 thread_info_t *ti = arg; in thread_exiting() local
181 if (ti != NULL) in thread_exiting()
182 log_enter(&ti->ti_log); in thread_exiting()
185 if (ti != NULL) { in thread_exiting()
187 uu_list_remove(thread_list, ti); in thread_exiting()
198 if (ti != NULL && ti != &main_thread_info) in thread_exiting()
199 thread_info_free(ti); in thread_exiting()
203 thread_newstate(thread_info_t *ti, thread_state_t newstate) in thread_newstate() argument
205 ti->ti_ucred_read = 0; /* invalidate cached ucred */ in thread_newstate()
206 if (newstate != ti->ti_state) { in thread_newstate()
207 ti->ti_prev_state = ti->ti_state; in thread_newstate()
208 ti->ti_state = newstate; in thread_newstate()
209 ti->ti_lastchange = gethrtime(); in thread_newstate()
226 thread_info_t *ti = thread_self(); in get_ucred() local
227 ucred_t **ret = &ti->ti_ucred; in get_ucred()
229 if (ti->ti_ucred_read) in get_ucred()
234 ti->ti_ucred_read = 1; in get_ucred()
266 thread_info_t *ti = thread_self(); in get_audit_session() local
268 return (ti->ti_active_client->rc_adt_session); in get_audit_session()
274 thread_info_t *ti = arg; in thread_start() local
281 ti); in thread_start()
283 (void) pthread_setspecific(thread_info_key, ti); in thread_start()
285 thread_newstate(ti, TI_DOOR_RETURN); in thread_start()
297 thread_info_t *ti; in new_thread_needed() local
306 if ((ti = uu_zalloc(sizeof (*ti))) == NULL) in new_thread_needed()
309 uu_list_node_init(ti, &ti->ti_node, thread_pool); in new_thread_needed()
310 ti->ti_state = TI_CREATED; in new_thread_needed()
311 ti->ti_prev_state = TI_CREATED; in new_thread_needed()
313 if ((ti->ti_ucred = uu_zalloc(ucred_size())) == NULL) in new_thread_needed()
318 if ((errno = pthread_create(&ti->ti_thread, &thread_attr, thread_start, in new_thread_needed()
319 ti)) != 0) { in new_thread_needed()
333 if (ti != NULL) in new_thread_needed()
334 thread_info_free(ti); in new_thread_needed()
547 thread_info_t *ti = &main_thread_info; in main() local
754 (void) memset(ti, '\0', sizeof (*ti)); in main()
755 uu_list_node_init(ti, &ti->ti_node, thread_pool); in main()
757 ti); in main()
759 ti->ti_thread = pthread_self(); in main()
760 ti->ti_state = TI_SIGNAL_WAIT; in main()
761 ti->ti_prev_state = TI_SIGNAL_WAIT; in main()
763 (void) pthread_setspecific(thread_info_key, ti); in main()