task_threads.html   [plain text]

<strong>Function</strong> - Return the target task's list of threads.
<strong>kern_return_t   task_threads</strong>
                <strong>(task_t</strong>                                    <var>task</var>,
                 <strong>thread_act_port_array_t</strong>            <var>thread_list</var>,
                 <strong>mach_msg_type_number_t*</strong>           <var>thread_count</var><strong>);</strong>
<dt> <var>task</var> 
[in task send right]
The port for the task for which the thread list is to 
be returned.
<dt> <var>thread_list</var> 
[out pointer to dynamic array of thread send rights]
The returned list of 
threads within <var>task</var>, in no particular order.
<dt> <var>thread_count</var> 
[out scalar]
The returned count of threads in <var>thread_list</var>.
The <strong>task_threads</strong> function returns a list of the threads
within <var>task</var>.  The calling 
task or thread also receives a send right to the kernel port
for each listed thread.
Only generic errors apply.
<a href="thread_create.html"><strong>thread_create</strong></a>,
<a href="thread_terminate.html"><strong>thread_terminate</strong></a>,
<a href="thread_suspend.html"><strong>thread_suspend</strong></a>.