HTL_thread_executor_create
Creates an executor.
Interface Definition
int HTL_thread_executor_create(HTL_thread_scheduler_t scheduler, HTL_thread_executor_t *executor);
Description
HTL_thread_executor_create() creates a new executor and returns the executor handle through executor.
- If scheduler is HTL_THREAD_SCHEDULER_NULL, the scheduler with the basic FIFO queue and default configuration is used.
- If scheduler is not HTL_THREAD_SCHEDULER_NULL, this scheduler cannot be reused to create another executor.
If the scheduler is not configured to be automatically released, manually release the scheduler after releasing the executor. The executor must be released by HTL_thread_executor_free() after being used.
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
scheduler |
HTL_thread_scheduler_t |
Handle to the executor. |
Input |
executor |
HTL_thread_executor_t * |
Address of the handle to the executor. |
Output |
Return Value
- HTL_THREAD_SUCCESS: success.
- Other values: failure. For details, see the error code descriptions.
Example
1 2 3 4 | /* Create executor */ for (i = 1; i < g_num_executors; i++) { ret = HTL_thread_executor_create(HTL_THREAD_SCHEDULER_NULL, &executors[i]); } |
Parent topic: Executor Functions