HTL_thread_executor_create_basic
Creates a basic executor.
Interface Definition
int HTL_thread_executor_create_basic(HTL_thread_scheduler_type_t sched_type, int num_pools, HTL_thread_pool_t *thread_pools, HTL_thread_scheduler_config_t sched_config, HTL_thread_executor *executor);
Description
HTL_thread_executor_create_basic() creates a basic executor defined by HTL and returns the executor handle through executor. The executor must be released by HTL_thread_executor_free() after being used.
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
sched_type |
HTL_thread_scheduler_type_t |
Predefined scheduler. |
Input |
num_pools |
int |
Number of thread pools. |
Input |
thread_pools |
HTL_thread_pool_t * |
Address to the thread pools. |
Input |
sched_config |
HTL_thread_scheduler_config_t |
Scheduler configuration. |
Input |
executor |
HTL_thread_executor * |
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 5 | /* Create executor */ for (i = 1; i < g_num_executors; i++) { ret = HTL_thread_executor_create_basic(HTL_THREAD_SCHEDULER_DEFAULT, NUM_POOLS, g_pools, HTL_THREAD_SCHEDULER_CONFIG_NULL, &executors[i]); } |