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