Skip to main content

ddsrt_thread_create

Function ddsrt_thread_create 

Source
pub unsafe extern "C" fn ddsrt_thread_create(
    thread: *mut ddsrt_thread_t,
    name: *const c_char,
    attr: *const ddsrt_threadattr_t,
    start_routine: ddsrt_thread_routine_t,
    arg: *mut c_void,
) -> dds_return_t
Expand description

@brief Create a new thread.

Creates a new thread of control that executes concurrently with the calling thread. The new thread applies the function start_routine passing it arg as first argument.

The new thread terminates by returning from the start_routine function. The created thread is identified by the returned threadId.

@param[out] thread Location where thread id is stored. @param[in] name Name assigned to created thread. @param[in] attr Attributes to create thread with. @param[in] start_routine Function to execute in created thread. @param[in] arg Argument passed to @start_routine.

@returns A dds_return_t indicating success or failure.

@retval DDS_RETCODE_OK Thread successfully created. @retval DDS_RETCODE_ERROR Thread could not be created.