1 <h2>thread_create_running
</h2>
4 <strong>Function
</strong> - Optimized creation of a running thread.
7 <strong>kern_return_t thread_create_running
</strong>
8 <strong>(task_t
</strong> <var>parent_task
</var>,
9 <strong>thread_state_flavor_t
</strong> <var>flavor
</var>,
10 <strong>thread_state_t
</strong> <var>state
</var>,
11 <strong>thread_act_t
</strong> <var>child_thread
</var><strong>);
</strong>
16 <dt> <var>parent_task
</var>
19 The port for the task that is to contain the new
22 <dt> <var>flavor
</var>
25 The type of state to establish. Valid values correspond to
26 supported machine architecture features.
30 [pointer to in structure]
31 State information for the specified thread.
33 <dt> <var>child_thread
</var>
35 [out thread send right]
36 The kernel-assigned name for the new thread.
40 The
<strong>thread_create_running
</strong> function creates a new thread
41 within
<var>parent_task
</var>.
42 The new thread has is not suspended. Its initial state is given
43 by
<var>state
</var>.
<var>flavor
</var> specifies the type of state to set.
45 The format of the state to set is machine specific; it is defined in
46 \*L
<mach/thread_status.h
>\*O.
48 The new thread holds a send right for its thread kernel port.
50 thread's kernel port is also returned to the calling task or
51 thread in
<var>child_thread
</var>.
52 The new thread's exception ports are set to
<strong>MACH_PORT_NULL
</strong>.
55 This is an optimized form of the sequence:
<strong>thread_create
</strong>,
56 <strong>thread_set_state
</strong>
57 and
<strong>thread_resume
</strong>.
58 <h3>RETURN VALUES
</h3>
60 Only generic errors apply.
61 <h3>RELATED INFORMATION
</h3>
64 <a href=
"task_create.html"><strong>task_create
</strong></a>,
65 <a href=
"task_threads.html"><strong>task_threads
</strong></a>,
66 <a href=
"thread_get_special_port.html"><strong>thread_get_special_port
</strong></a>,
67 <a href=
"thread_get_state.html"><strong>thread_get_state
</strong></a>,
68 <a href=
"thread_resume.html"><strong>thread_resume
</strong></a>,
69 <a href=
"thread_set_special_port.html"><strong>thread_set_special_port
</strong></a>,
70 <a href=
"thread_set_state.html"><strong>thread_set_state
</strong></a>,
71 <a href=
"thread_suspend.html"><strong>thread_suspend
</strong></a>,
72 <a href=
"thread_terminate.html"><strong>thread_terminate
</strong></a>,
73 <a href=
"thread_create.html"><strong>thread_create
</strong></a>.