osfmk/man/thread_info.html
Function - Return information about a thread.
**kern\_return\_t thread\_info**** (thread\_act\_t **target\_thread,** thread\_flavor\_t **flavor,** thread\_info\_t **thread\_info,** mach\_msg\_type\_number\_t **thread\_info\_count** );**
target_thread[in thread send right] The thread for which the information is to be returned.
flavor[in scalar] The type of information to be returned. Valid values are:
THREAD_BASIC_INFO Returns basic information about the thread, such as the thread's run state and suspend count. The returned structure is thread_basic_info.
THREAD_SCHED_FIFO_INFO Returns FIFO scheduling policy information about the thread. The returned structure is policy_fifo_info.
THREAD_SCHED_RR_INFO Returns round-robin scheduling policy information about the thread. The returned structure is policy_rr_info.
THREAD_SCHED_TIMESHARE_INFO Returns timeshare scheduling policy information about the thread. The returned structure is policy_timeshare_info.
thread_info[out structure] Information about the specified thread.
thread_info_count[in/out scalar] On input, the maximum size of the buffer; on output, the size returned (in natural-sized units).
The thread_info function returns an information structure of type flavor.
At any given time, a thread has only one scheduling policy in effect for it. Thus, only one of the scheduling information structures will be valid, that so indicated by the policy value returned by THREAD_BASIC_INFO.
Only generic errors apply.
Functions: task_info, task_threads, thread_get_state, thread_set_special_port, thread_set_state.
Data Structures: thread_basic_info, policy_timeshare_info, policy_fifo_info, policy_rr_info.