]>
Commit | Line | Data |
---|---|---|
13fec989 A |
1 | <h2>thread_create_running</h2> |
2 | <hr> | |
3 | <p> | |
4 | <strong>Function</strong> - Optimized creation of a running thread. | |
5 | <h3>SYNOPSIS</h3> | |
6 | <pre> | |
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> | |
12 | </pre> | |
13 | <h3>PARAMETERS</h3> | |
14 | <dl> | |
15 | <p> | |
16 | <dt> <var>parent_task</var> | |
17 | <dd> | |
18 | [in task send right] | |
19 | The port for the task that is to contain the new | |
20 | thread. | |
21 | <p> | |
22 | <dt> <var>flavor</var> | |
23 | <dd> | |
24 | [in scalar] | |
25 | The type of state to establish. Valid values correspond to | |
26 | supported machine architecture features. | |
27 | <p> | |
28 | <dt> <var>state</var> | |
29 | <dd> | |
30 | [pointer to in structure] | |
31 | State information for the specified thread. | |
32 | <p> | |
33 | <dt> <var>child_thread</var> | |
34 | <dd> | |
35 | [out thread send right] | |
36 | The kernel-assigned name for the new thread. | |
37 | </dl> | |
38 | <h3>DESCRIPTION</h3> | |
39 | <p> | |
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. | |
44 | <p> | |
45 | The format of the state to set is machine specific; it is defined in | |
46 | \*L<mach/thread_status.h>\*O. | |
47 | <p> | |
48 | The new thread holds a send right for its thread kernel port. | |
49 | A send right for the | |
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>. | |
53 | <h3>NOTES</h3> | |
54 | <p> | |
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> | |
59 | <p> | |
60 | Only generic errors apply. | |
61 | <h3>RELATED INFORMATION</h3> | |
62 | <p> | |
63 | Functions: | |
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>. |