thread_create_running.html   [plain text]

<strong>Function</strong> - Optimized creation of a running thread.
<strong>kern_return_t   thread_create_running</strong>
                <strong>(task_t</strong>                             <var>parent_task</var>,
                 <strong>thread_state_flavor_t</strong>                   <var>flavor</var>,
                 <strong>thread_state_t</strong>                           <var>state</var>,
                 <strong>thread_act_t</strong>                      <var>child_thread</var><strong>);</strong>
<dt> <var>parent_task</var> 
[in task send right]
The port for the task that is to contain the new 
<dt> <var>flavor</var> 
[in scalar]
The type of state to establish.  Valid values correspond to 
supported machine architecture features.
<dt> <var>state</var> 
[pointer to in structure]
State information for the specified thread.
<dt> <var>child_thread</var> 
[out thread send right]
The kernel-assigned name for the new thread.
The <strong>thread_create_running</strong> function creates a new thread
within <var>parent_task</var>. 
The new thread has is not suspended.  Its initial state is given
by <var>state</var>.  <var>flavor</var> specifies the type of state to set.
The format of the state to set is machine specific; it is defined in 
The new thread holds a send right for its thread kernel port.
A send right for the 
thread's kernel port is also returned to the calling task or
thread in <var>child_thread</var>. 
The new thread's exception ports are set to <strong>MACH_PORT_NULL</strong>.
This is an optimized form of the sequence: <strong>thread_create</strong>,
and <strong>thread_resume</strong>.
Only generic errors apply.
<a href="task_create.html"><strong>task_create</strong></a>,
<a href="task_threads.html"><strong>task_threads</strong></a>,
<a href="thread_get_special_port.html"><strong>thread_get_special_port</strong></a>,
<a href="thread_get_state.html"><strong>thread_get_state</strong></a>,
<a href="thread_resume.html"><strong>thread_resume</strong></a>,
<a href="thread_set_special_port.html"><strong>thread_set_special_port</strong></a>,
<a href="thread_set_state.html"><strong>thread_set_state</strong></a>,
<a href="thread_suspend.html"><strong>thread_suspend</strong></a>,
<a href="thread_terminate.html"><strong>thread_terminate</strong></a>,
<a href="thread_create.html"><strong>thread_create</strong></a>.