xref: /xnu-8020.140.41/osfmk/man/thread_set_state.html (revision 27b03b360a988dfd3dfdf34262bb0042026747cc)
1*27b03b36SApple OSS Distributions<h2>thread_set_state</h2>
2*27b03b36SApple OSS Distributions<hr>
3*27b03b36SApple OSS Distributions<p>
4*27b03b36SApple OSS Distributions<strong>Function</strong> - Set the target thread's user-mode execution state.
5*27b03b36SApple OSS Distributions<h3>SYNOPSIS</h3>
6*27b03b36SApple OSS Distributions<pre>
7*27b03b36SApple OSS Distributions<strong>kern_return_t   thread_set_state</strong>
8*27b03b36SApple OSS Distributions                <strong>(thread_act_t</strong>                     <var>target_thread</var>,
9*27b03b36SApple OSS Distributions                 <strong>thread_state_flavor_t</strong>                   <var>flavor</var>,
10*27b03b36SApple OSS Distributions                 <strong>thread_state_t</strong>                       <var>new_state</var>,
11*27b03b36SApple OSS Distributions                 <strong>target_thread</strong>                  <var>new_state_count</var><strong>);</strong>
12*27b03b36SApple OSS Distributions</pre>
13*27b03b36SApple OSS Distributions<h3>PARAMETERS</h3>
14*27b03b36SApple OSS Distributions<dl>
15*27b03b36SApple OSS Distributions<p>
16*27b03b36SApple OSS Distributions<dt> <var>target_thread</var>
17*27b03b36SApple OSS Distributions<dd>
18*27b03b36SApple OSS Distributions[in thread send right]
19*27b03b36SApple OSS DistributionsThe thread for which to set the execution state.
20*27b03b36SApple OSS DistributionsThe calling thread cannot specify itself.
21*27b03b36SApple OSS Distributions<p>
22*27b03b36SApple OSS Distributions<dt> <var>flavor</var>
23*27b03b36SApple OSS Distributions<dd>
24*27b03b36SApple OSS Distributions[in scalar]
25*27b03b36SApple OSS DistributionsThe type of state to set.  Valid values correspond to
26*27b03b36SApple OSS Distributionssupported machine architecture features.
27*27b03b36SApple OSS Distributions<p>
28*27b03b36SApple OSS Distributions<dt> <var>new_state</var>
29*27b03b36SApple OSS Distributions<dd>
30*27b03b36SApple OSS Distributions[pointer to in structure]
31*27b03b36SApple OSS DistributionsState information for the specified thread.
32*27b03b36SApple OSS Distributions<p>
33*27b03b36SApple OSS Distributions<dt> <var>new_state_count</var>
34*27b03b36SApple OSS Distributions<dd>
35*27b03b36SApple OSS Distributions[in scalar]
36*27b03b36SApple OSS DistributionsThe size of the buffer (in natural-sized units).
37*27b03b36SApple OSS Distributions</dl>
38*27b03b36SApple OSS Distributions<h3>DESCRIPTION</h3>
39*27b03b36SApple OSS Distributions<p>
40*27b03b36SApple OSS DistributionsThe <strong>thread_set_state</strong> function sets the execution state
41*27b03b36SApple OSS Distributions(for example, the
42*27b03b36SApple OSS Distributionsmachine registers) for <var>target_thread</var>.  <var>flavor</var> specifies the type
43*27b03b36SApple OSS Distributionsof state to set.
44*27b03b36SApple OSS Distributions<p>
45*27b03b36SApple OSS DistributionsThe format of the state to set is machine specific; it is defined in
46*27b03b36SApple OSS Distributions<strong>mach/thread_status.h</strong>.
47*27b03b36SApple OSS Distributions<h3>RETURN VALUES</h3>
48*27b03b36SApple OSS Distributions<p>
49*27b03b36SApple OSS DistributionsOnly generic errors apply.
50*27b03b36SApple OSS Distributions<h3>RELATED INFORMATION</h3>
51*27b03b36SApple OSS Distributions<p>
52*27b03b36SApple OSS DistributionsFunctions:
53*27b03b36SApple OSS Distributions<a href="task_info.html"><strong>task_info</strong></a>,
54*27b03b36SApple OSS Distributions<a href="thread_get_state.html"><strong>thread_get_state</strong></a>,
55*27b03b36SApple OSS Distributions<a href="thread_info.html"><strong>thread_info</strong></a>.
56