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