1 <h2>thread_set_policy
</h2>
4 <strong>Function
</strong> - Set target thread's scheduling policy state. (Protected Interface.)
7 <strong>kern_return_t thread_set_policy
</strong>
8 <strong>(thread_act_t
</strong> <var>thread
</var>,
9 <strong>processor_set_t
</strong> <var>processor_set
</var>,
10 <strong>policy_t
</strong> <var>policy
</var>,
11 <strong>policy_base_t
</strong> <var>base
</var>,
12 <strong>mach_msg_type_number_t
</strong> <var>base_count
</var>,
13 <strong>policy_limit_t
</strong> <var>limit
</var>,
14 <strong>mach_msg_type_number_
</strong> <var>limit_count
</var><strong>);
</strong>
19 <dt> <var>thread
</var>
21 [in thread send right]
22 The thread scheduling policy is to be set.
24 <dt> <var>processor_set
</var>
26 [in processor-set-control send right]
27 The control port for the processor
28 set to which the thread is currently assigned.
30 <dt> <var>policy
</var>
33 Policy to be set. The values currently defined are
<strong>POLICY_TIMESHARE
</strong>,
34 <strong>POLICY_RR
</strong> (round robin) and
<strong>POLICY_FIFO
</strong> (firstin, first-out).
38 [pointer to in structure]
39 Base policy specific data,
<strong>policy_fifo_base
</strong>,
40 <strong>policy_rr_base
</strong> or
<strong>policy_timeshare_base
</strong>.
42 <dt> <var>base_count
</var>
45 The size of the buffer (in natural-sized units).
49 [pointer to in structure]
50 Policy specific limits,
<strong>policy_fifo_limit
</strong>,
51 <strong>policy_rr_limit
</strong> or
<strong>policy_timeshare_limit
</strong>.
53 <dt> <var>limit_count
</var>
56 The size of the buffer (in natural-sized units).
60 The
<strong>thread_set_policy
</strong> function sets the scheduling
61 attributes, both base and limit, for
<var>thread
</var>.
62 <var>policy
</var> may be any policy implemented by the processor set
63 whether or not it is enabled.
64 <h3>RETURN VALUES
</h3>
67 <dt> <strong>KERN_INVALID_PROCESSOR_SET
</strong>
69 <var>processor_set
</var> is not the thread's processor set control port.
71 <h3>RELATED INFORMATION
</h3>
74 <a href=
"P_set_policy_control.html"><strong>processor_set_policy_control
</strong></a>,
75 <a href=
"thread_policy.html"><strong>thread_policy
</strong></a>,
76 <a href=
"task_policy.html"><strong>task_policy
</strong></a>,
77 <a href=
"task_set_policy.html"><strong>task_set_policy
</strong></a>.
80 <a href=
"policy_fifo_info.html"><strong>policy_fifo_info
</strong></a>,
81 <a href=
"policy_rr_info.html"><strong>policy_rr_info
</strong></a>,
82 <a href=
"policy_timeshare_info.html"><strong>policy_timeshare_info
</strong></a>.