Mac OS X Reference Library Apple Developer
Search

thread.h

Includes:
<mach/kern_return.h>
<mach/mach_types.h>
<mach/message.h>
<mach/boolean.h>
<mach/vm_param.h>
<mach/thread_info.h>
<mach/thread_status.h>
<mach/exception_types.h>
<kern/kern_types.h>
<sys/cdefs.h>

Overview

Use the links in the table of contents to the left to access the documentation.



Functions

kernel_thread_start

Create a kernel thread.


kernel_thread_start


Create a kernel thread.


extern kern_return_t kernel_thread_start( 
    thread_continue_t continuation, 
    void *parameter, 
    thread_t *new_thread);  
Parameters
continuation

A C-function pointer where the thread will begin execution.

parameter

Caller specified data to be passed to the new thread.

new_thread

Reference to the new thread is returned in this parameter.

Return Value

Returns KERN_SUCCESS on success or an appropriate kernel code type.

Discussion

This function takes three input parameters, namely reference to the function that the thread should execute, caller specified data and a reference which is used to return the newly created kernel thread. The function returns KERN_SUCCESS on success or an appropriate kernel code type indicating the error. It may be noted that the caller is responsible for explicitly releasing the reference to the created thread when no longer needed. This should be done by calling thread_deallocate(new_thread).

 

Did this document help you? Yes It's good, but... Not helpful...

Last Updated: 2010-07-29