osfmk/man/thread_set_state.html
Function - Set the target thread's user-mode execution state.
**kern\_return\_t thread\_set\_state**** (thread\_act\_t **target\_thread,** thread\_state\_flavor\_t **flavor,** thread\_state\_t **new\_state,** target\_thread **new\_state\_count** );**
target_thread[in thread send right] The thread for which to set the execution state. The calling thread cannot specify itself.
flavor[in scalar] The type of state to set. Valid values correspond to supported machine architecture features.
new_state[pointer to in structure] State information for the specified thread.
new_state_count[in scalar] The size of the buffer (in natural-sized units).
The thread_set_state function sets the execution state (for example, the machine registers) for target_thread. flavor specifies the type of state to set.
The format of the state to set is machine specific; it is defined in mach/thread_status.h.
Only generic errors apply.
Functions: task_info, thread_get_state, thread_info.