1*0f4c859eSApple OSS Distributions<h2>thread_policy</h2> 2*0f4c859eSApple OSS Distributions<hr> 3*0f4c859eSApple OSS Distributions<p> 4*0f4c859eSApple OSS Distributions<strong>Function</strong> - Set target thread's scheduling policy state. 5*0f4c859eSApple OSS Distributions<h3>SYNOPSIS</h3> 6*0f4c859eSApple OSS Distributions<pre> 7*0f4c859eSApple OSS Distributions<strong>kern_return_t thread_policy</strong> 8*0f4c859eSApple OSS Distributions <strong>(thread_act_t</strong> <var>thread</var>, 9*0f4c859eSApple OSS Distributions <strong>policy_t</strong> <var>policy</var>, 10*0f4c859eSApple OSS Distributions <strong>policy_base_t</strong> <var>base</var>, 11*0f4c859eSApple OSS Distributions <strong>base</strong> <var>base_count</var>, 12*0f4c859eSApple OSS Distributions <strong>boolean_t</strong> <var>set_limit</var><strong>);</strong> 13*0f4c859eSApple OSS Distributions</pre> 14*0f4c859eSApple OSS Distributions<h3>PARAMETERS</h3> 15*0f4c859eSApple OSS Distributions<dl> 16*0f4c859eSApple OSS Distributions<p> 17*0f4c859eSApple OSS Distributions<dt> <var>thread</var> 18*0f4c859eSApple OSS Distributions<dd> 19*0f4c859eSApple OSS Distributions[in thread send right] 20*0f4c859eSApple OSS DistributionsThe thread scheduling policy is to be set. 21*0f4c859eSApple OSS Distributions<p> 22*0f4c859eSApple OSS Distributions<dt> <var>policy</var> 23*0f4c859eSApple OSS Distributions<dd> 24*0f4c859eSApple OSS Distributions[in scalar] 25*0f4c859eSApple OSS DistributionsPolicy to be set. The values currently defined are <strong>POLICY_TIMESHARE</strong>, 26*0f4c859eSApple OSS Distributions<strong>POLICY_RR</strong> (round robin) and <strong>POLICY_FIFO</strong> (firstin, first-out). 27*0f4c859eSApple OSS Distributions<p> 28*0f4c859eSApple OSS Distributions<dt> <var>base</var> 29*0f4c859eSApple OSS Distributions<dd> 30*0f4c859eSApple OSS Distributions[pointer to in structure] 31*0f4c859eSApple OSS DistributionsBase scheduling policy specific data, 32*0f4c859eSApple OSS Distributions<strong>policy_fifo_base</strong>, <strong>policy_rr_base</strong> or <strong>policy_timeshare_base</strong>. 33*0f4c859eSApple OSS Distributions<p> 34*0f4c859eSApple OSS Distributions<dt> <var>base_count</var> 35*0f4c859eSApple OSS Distributions<dd> 36*0f4c859eSApple OSS Distributions[in scalar] 37*0f4c859eSApple OSS DistributionsThe size of the buffer (in natural-sized units). 38*0f4c859eSApple OSS Distributions<p> 39*0f4c859eSApple OSS Distributions<dt> <var>set_limit</var> 40*0f4c859eSApple OSS Distributions<dd> 41*0f4c859eSApple OSS Distributions[in scalar] 42*0f4c859eSApple OSS DistributionsTrue if the thread's scheduling limits should be restricted to 43*0f4c859eSApple OSS Distributionsallow no more service than specified by <var>base</var>. 44*0f4c859eSApple OSS Distributions</dl> 45*0f4c859eSApple OSS Distributions<h3>DESCRIPTION</h3> 46*0f4c859eSApple OSS Distributions<p> 47*0f4c859eSApple OSS DistributionsThe <strong>thread_policy</strong> function sets the scheduling policy 48*0f4c859eSApple OSS Distributionsto be applied to thread. <var>policy</var> must be a scheduling policy 49*0f4c859eSApple OSS Distributionscurrently "enabled" for the thread's assigned processor set. 50*0f4c859eSApple OSS Distributions<h3>RETURN VALUES</h3> 51*0f4c859eSApple OSS Distributions<dl> 52*0f4c859eSApple OSS Distributions<p> 53*0f4c859eSApple OSS Distributions<dt> <strong>KERN_INVALID_POLICY</strong> 54*0f4c859eSApple OSS Distributions<dd> 55*0f4c859eSApple OSS DistributionsThe processor set to which <var>thread</var> is currently assigned does 56*0f4c859eSApple OSS Distributionsnot currently enable <var>policy</var>. 57*0f4c859eSApple OSS Distributions<p> 58*0f4c859eSApple OSS Distributions<dt> <strong>KERN_POLICY_LIMIT</strong> 59*0f4c859eSApple OSS Distributions<dd> 60*0f4c859eSApple OSS DistributionsThe specified scheduling attributes exceeds the thread's limits. 61*0f4c859eSApple OSS Distributions</dl> 62*0f4c859eSApple OSS Distributions<h3>RELATED INFORMATION</h3> 63*0f4c859eSApple OSS Distributions<p> 64*0f4c859eSApple OSS DistributionsFunctions: 65*0f4c859eSApple OSS Distributions<a href="P_set_policy_control.html"><strong>processor_set_policy_control</strong></a>, 66*0f4c859eSApple OSS Distributions<a href="thread_set_policy.html"><strong>thread_set_policy</strong></a>, 67*0f4c859eSApple OSS Distributions<a href="task_policy.html"><strong>task_policy</strong></a>, 68*0f4c859eSApple OSS Distributions<a href="task_set_policy.html"><strong>task_set_policy</strong></a>. 69*0f4c859eSApple OSS Distributions<p> 70*0f4c859eSApple OSS DistributionsData Structures: 71*0f4c859eSApple OSS Distributions<a href="policy_fifo_info.html"><strong>policy_fifo_info</strong></a>, 72*0f4c859eSApple OSS Distributions<a href="policy_rr_info.html"><strong>policy_rr_info</strong></a>, 73*0f4c859eSApple OSS Distributions<a href="policy_timeshare_info.html"><strong>policy_timeshare_info</strong></a>. 74