osfmk/man/thread_policy.html
Function - Set target thread's scheduling policy state.
**kern\_return\_t thread\_policy**** (thread\_act\_t **thread,** policy\_t **policy,** policy\_base\_t **base,** base **base\_count,** boolean\_t **set\_limit** );**
thread[in thread send right] The thread scheduling policy is to be set.
policy[in scalar] Policy to be set. The values currently defined are POLICY_TIMESHARE , POLICY_RR (round robin) and POLICY_FIFO (firstin, first-out).
base[pointer to in structure] Base scheduling policy specific data, policy_fifo_base , policy_rr_base or policy_timeshare_base.
base_count[in scalar] The size of the buffer (in natural-sized units).
set_limit[in scalar] True if the thread's scheduling limits should be restricted to allow no more service than specified by base.
The thread_policy function sets the scheduling policy to be applied to thread. policy must be a scheduling policy currently "enabled" for the thread's assigned processor set.
KERN_INVALID_POLICY The processor set to which thread is currently assigned does not currently enable policy.
KERN_POLICY_LIMIT The specified scheduling attributes exceeds the thread's limits.
Functions: processor_set_policy_control, thread_set_policy, task_policy, task_set_policy.
Data Structures: policy_fifo_info, policy_rr_info, policy_timeshare_info.