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