]> git.saurik.com Git - apple/xnu.git/blame - osfmk/man/thread_create.html
xnu-344.tar.gz
[apple/xnu.git] / osfmk / man / thread_create.html
CommitLineData
9bccf70c 1<h2>thread_create</h2>\r<hr>\r<p>\r<strong>Function</strong> - Create a thread within a task.\r<h3>SYNOPSIS</h3>\r<pre>\r<strong>kern_return_t thread_create</strong>\r <strong>(task_t</strong> <var>parent_task</var>,\r <strong>thread_act_t</strong> <var>child_thread</var><strong>);</strong>\r</pre>\r<h3>PARAMETERS</h3>\r<dl>\r<p>\r<dt> <var>parent_task</var> \r<dd>\r[in task send right]\rThe port for the task that is to contain the new \rthread.\r<p>\r<dt> <var>child_thread</var> \r<dd>\r[out thread send right]\rThe kernel-assigned name for the new thread.\r</dl>\r<h3>DESCRIPTION</h3>\r<p>\rThe <strong>thread_create</strong> function creates a new thread within\r<var>parent_task</var>. The new thread has a suspend count of one and \rno processor state.\r<p>\rThe new thread holds a send right for its thread kernel port.\rA send right for the \rthread's kernel port is also returned to the calling task or\rthread in <var>child_thread</var>. \rThe new thread's exception ports are set to <strong>MACH_PORT_NULL</strong>.\r<h3>NOTES</h3>\r<p>\rTo get a new thread running, first use <strong>thread_set_state</strong>\rto set a processor state \rfor the thread. Then, use <strong>thread_resume</strong> to schedule\rthe thread for execution. \rAlternately, use <strong>thread_create_running</strong>.\r<h3>RETURN VALUES</h3>\r<p>\rOnly generic errors apply.\r<h3>RELATED INFORMATION</h3>\r<p>\rFunctions:\r<a href="task_create.html"><strong>task_create</strong></a>,\r<a href="task_threads.html"><strong>task_threads</strong></a>,\r<a href="thread_get_special_port.html"><strong>thread_get_special_port</strong></a>,\r<a href="thread_get_state.html"><strong>thread_get_state</strong></a>,\r<a href="thread_resume.html"><strong>thread_resume</strong></a>,\r<a href="thread_set_special_port.html"><strong>thread_set_special_port</strong></a>,\r<a href="thread_set_state.html"><strong>thread_set_state</strong></a>,\r<a href="thread_suspend.html"><strong>thread_suspend</strong></a>,\r<a href="thread_terminate.html"><strong>thread_terminate</strong></a>,\r<a href="thread_create_running.html"><strong>thread_create_running</strong></a>.\r