我要评分
获取效率
正确性
完整性
易理解

HTL_thread_executor_join

Waits until an executor terminates.

Interface Definition

int HTL_thread_executor_join(HTL_thread_executor_t executor);

Description

HTL_thread_executor_join() is used by the caller to wait until the executor terminates. This function cannot release the executor of the running caller and the primary executor.

Parameters

Parameter

Type

Description

Input/Output

executor

HTL_thread_executor

Handle to the executor.

Input/Output

Return Value

  • HTL_THREAD_SUCCESS: success.
  • Other values: failure. For details, see the error code descriptions.

Example

    num_executors = NUM_EXECUTOR;
    HTL_thread_executor_t *executors;

    executors = (HTL_thread_executor_t *)malloc(sizeof(HTL_thread_executor_t) * num_executors);
    for (i = 1; i < num_executors; i++) {
        HTL_thread_executor_create_basic(HTL_THREAD_SCHEDULER_DEFAULT, 1, &g_pools[i],
            HTL_THREAD_SCHEDULER_CONFIG_NULL, &executors[i]);
    }

    /* join executor */
    for (i = 1; i < num_executors; i++) {
        HTL_thread_executor_join(executors[i]);
    }