xref: /xnu-11417.121.6/osfmk/man/thread_create_running.html (revision a1e26a70f38d1d7daa7b49b258e2f8538ad81650)
1*a1e26a70SApple OSS Distributions<h2>thread_create_running</h2>
2*a1e26a70SApple OSS Distributions<hr>
3*a1e26a70SApple OSS Distributions<p>
4*a1e26a70SApple OSS Distributions<strong>Function</strong> - Optimized creation of a running thread.
5*a1e26a70SApple OSS Distributions<h3>SYNOPSIS</h3>
6*a1e26a70SApple OSS Distributions<pre>
7*a1e26a70SApple OSS Distributions<strong>kern_return_t   thread_create_running</strong>
8*a1e26a70SApple OSS Distributions                <strong>(task_t</strong>                             <var>parent_task</var>,
9*a1e26a70SApple OSS Distributions                 <strong>thread_state_flavor_t</strong>                   <var>flavor</var>,
10*a1e26a70SApple OSS Distributions                 <strong>thread_state_t</strong>                           <var>state</var>,
11*a1e26a70SApple OSS Distributions                 <strong>thread_act_t</strong>                      <var>child_thread</var><strong>);</strong>
12*a1e26a70SApple OSS Distributions</pre>
13*a1e26a70SApple OSS Distributions<h3>PARAMETERS</h3>
14*a1e26a70SApple OSS Distributions<dl>
15*a1e26a70SApple OSS Distributions<p>
16*a1e26a70SApple OSS Distributions<dt> <var>parent_task</var>
17*a1e26a70SApple OSS Distributions<dd>
18*a1e26a70SApple OSS Distributions[in task send right]
19*a1e26a70SApple OSS DistributionsThe port for the task that is to contain the new
20*a1e26a70SApple OSS Distributionsthread.
21*a1e26a70SApple OSS Distributions<p>
22*a1e26a70SApple OSS Distributions<dt> <var>flavor</var>
23*a1e26a70SApple OSS Distributions<dd>
24*a1e26a70SApple OSS Distributions[in scalar]
25*a1e26a70SApple OSS DistributionsThe type of state to establish.  Valid values correspond to
26*a1e26a70SApple OSS Distributionssupported machine architecture features.
27*a1e26a70SApple OSS Distributions<p>
28*a1e26a70SApple OSS Distributions<dt> <var>state</var>
29*a1e26a70SApple OSS Distributions<dd>
30*a1e26a70SApple OSS Distributions[pointer to in structure]
31*a1e26a70SApple OSS DistributionsState information for the specified thread.
32*a1e26a70SApple OSS Distributions<p>
33*a1e26a70SApple OSS Distributions<dt> <var>child_thread</var>
34*a1e26a70SApple OSS Distributions<dd>
35*a1e26a70SApple OSS Distributions[out thread send right]
36*a1e26a70SApple OSS DistributionsThe kernel-assigned name for the new thread.
37*a1e26a70SApple OSS Distributions</dl>
38*a1e26a70SApple OSS Distributions<h3>DESCRIPTION</h3>
39*a1e26a70SApple OSS Distributions<p>
40*a1e26a70SApple OSS DistributionsThe <strong>thread_create_running</strong> function creates a new thread
41*a1e26a70SApple OSS Distributionswithin <var>parent_task</var>.
42*a1e26a70SApple OSS DistributionsThe new thread has is not suspended.  Its initial state is given
43*a1e26a70SApple OSS Distributionsby <var>state</var>.  <var>flavor</var> specifies the type of state to set.
44*a1e26a70SApple OSS Distributions<p>
45*a1e26a70SApple OSS DistributionsThe format of the state to set is machine specific; it is defined in
46*a1e26a70SApple OSS Distributions\*L<mach/thread_status.h>\*O.
47*a1e26a70SApple OSS Distributions<p>
48*a1e26a70SApple OSS DistributionsThe new thread holds a send right for its thread kernel port.
49*a1e26a70SApple OSS DistributionsA send right for the
50*a1e26a70SApple OSS Distributionsthread's kernel port is also returned to the calling task or
51*a1e26a70SApple OSS Distributionsthread in <var>child_thread</var>.
52*a1e26a70SApple OSS DistributionsThe new thread's exception ports are set to <strong>MACH_PORT_NULL</strong>.
53*a1e26a70SApple OSS Distributions<h3>NOTES</h3>
54*a1e26a70SApple OSS Distributions<p>
55*a1e26a70SApple OSS DistributionsThis is an optimized form of the sequence: <strong>thread_create</strong>,
56*a1e26a70SApple OSS Distributions<strong>thread_set_state</strong>
57*a1e26a70SApple OSS Distributionsand <strong>thread_resume</strong>.
58*a1e26a70SApple OSS Distributions<h3>RETURN VALUES</h3>
59*a1e26a70SApple OSS Distributions<p>
60*a1e26a70SApple OSS DistributionsOnly generic errors apply.
61*a1e26a70SApple OSS Distributions<h3>RELATED INFORMATION</h3>
62*a1e26a70SApple OSS Distributions<p>
63*a1e26a70SApple OSS DistributionsFunctions:
64*a1e26a70SApple OSS Distributions<a href="task_create.html"><strong>task_create</strong></a>,
65*a1e26a70SApple OSS Distributions<a href="task_threads.html"><strong>task_threads</strong></a>,
66*a1e26a70SApple OSS Distributions<a href="thread_get_special_port.html"><strong>thread_get_special_port</strong></a>,
67*a1e26a70SApple OSS Distributions<a href="thread_get_state.html"><strong>thread_get_state</strong></a>,
68*a1e26a70SApple OSS Distributions<a href="thread_resume.html"><strong>thread_resume</strong></a>,
69*a1e26a70SApple OSS Distributions<a href="thread_set_special_port.html"><strong>thread_set_special_port</strong></a>,
70*a1e26a70SApple OSS Distributions<a href="thread_set_state.html"><strong>thread_set_state</strong></a>,
71*a1e26a70SApple OSS Distributions<a href="thread_suspend.html"><strong>thread_suspend</strong></a>,
72*a1e26a70SApple OSS Distributions<a href="thread_terminate.html"><strong>thread_terminate</strong></a>,
73*a1e26a70SApple OSS Distributions<a href="thread_create.html"><strong>thread_create</strong></a>.
74