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