4 <strong>Function
</strong> - Set target thread's scheduling policy state.
7 <strong>kern_return_t thread_policy
</strong>
8 <strong>(thread_act_t
</strong> <var>thread
</var>,
9 <strong>policy_t
</strong> <var>policy
</var>,
10 <strong>policy_base_t
</strong> <var>base
</var>,
11 <strong>base
</strong> <var>base_count
</var>,
12 <strong>boolean_t
</strong> <var>set_limit
</var><strong>);
</strong>
17 <dt> <var>thread
</var>
19 [in thread send right]
20 The thread scheduling policy is to be set.
22 <dt> <var>policy
</var>
25 Policy to be set. The values currently defined are
<strong>POLICY_TIMESHARE
</strong>,
26 <strong>POLICY_RR
</strong> (round robin) and
<strong>POLICY_FIFO
</strong> (firstin, first-out).
30 [pointer to in structure]
31 Base scheduling policy specific data,
32 <strong>policy_fifo_base
</strong>,
<strong>policy_rr_base
</strong> or
<strong>policy_timeshare_base
</strong>.
34 <dt> <var>base_count
</var>
37 The size of the buffer (in natural-sized units).
39 <dt> <var>set_limit
</var>
42 True if the thread's scheduling limits should be restricted to
43 allow no more service than specified by
<var>base
</var>.
47 The
<strong>thread_policy
</strong> function sets the scheduling policy
48 to be applied to thread.
<var>policy
</var> must be a scheduling policy
49 currently "enabled" for the thread's assigned processor set.
50 <h3>RETURN VALUES
</h3>
53 <dt> <strong>KERN_INVALID_POLICY
</strong>
55 The processor set to which
<var>thread
</var> is currently assigned does
56 not currently enable
<var>policy
</var>.
58 <dt> <strong>KERN_POLICY_LIMIT
</strong>
60 The specified scheduling attributes exceeds the thread's limits.
62 <h3>RELATED INFORMATION
</h3>
65 <a href=
"P_set_policy_control.html"><strong>processor_set_policy_control
</strong></a>,
66 <a href=
"thread_set_policy.html"><strong>thread_set_policy
</strong></a>,
67 <a href=
"task_policy.html"><strong>task_policy
</strong></a>,
68 <a href=
"task_set_policy.html"><strong>task_set_policy
</strong></a>.
71 <a href=
"policy_fifo_info.html"><strong>policy_fifo_info
</strong></a>,
72 <a href=
"policy_rr_info.html"><strong>policy_rr_info
</strong></a>,
73 <a href=
"policy_timeshare_info.html"><strong>policy_timeshare_info
</strong></a>.