thread_info


Function - Return information about a thread.

SYNOPSIS

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);

PARAMETERS

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).

DESCRIPTION

The thread_info function returns an information structure of type flavor.

NOTES

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.

RETURN VALUES

Only generic errors apply.

RELATED INFORMATION

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.