osfmk/man/thread_get_state.html
Function - Return the execution state for a thread.
**kern\_return\_t thread\_get\_state**** (thread\_act\_t **target\_thread,** thread\_state\_flavor\_t **flavor,** thread\_state\_t **old\_state,** mach\_msg\_type\_number\_t **old\_state\_count** );**
target_thread[in thread send right] The thread for which the execution state is to be returned. The calling thread cannot specify itself.
flavor[in scalar] The type of execution state to be returned. Valid values correspond to supported machined architectures.
old_state[out structure] State information for the specified thread.
old_state_count[in/out scalar] On input, the maximum size of the buffer; on output, the size returned (in natural-sized units).
The thread_get_state function returns the execution state (for example, the machine registers) for target_thread. flavor specifies the type of state information returned.
The format of the data returned is machine specific; it is defined in *L*O.
Only generic errors apply.
Functions: task_info, thread_info, thread_set_state.