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

HTL_thread_scheduler_free

Releases a scheduler.

Interface Definition

int HTL_thread_scheduler_free(HTL_thread_scheduler_t *scheduler);

Description

HTL_thread_scheduler_free() releases the scheduler and sets scheduler to HTL_THREAD_SCHEDULER_NULL.

  • If the scheduler is created by HTL_thread_scheduler_create():

    If the scheduler release function free() is not NULL, the function invokes the scheduler release function free() and uses the scheduler handle scheduler as the first parameter. This function ignores the return value of free(). After the scheduler resource is destroyed, this function sets scheduler to HTL_THREAD_SCHEDULER_NULL.

  • If the scheduler is created by HTL_thread_scheduler_create_basic():

    After the scheduler resource is destroyed, this function sets scheduler to HTL_THREAD_SCHEDULER_NULL.

Parameters

Parameter

Type

Description

Input/Output

scheduler

HTL_thread_scheduler_t *

Address of the handle to the scheduler.

Input/Output

Return Value

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

Example

1
2
3
4
5
    HTL_thread_scheduler_t scheduler[NUM_EXECUTORS];    
    ...   
    for (i = 1; i < NUM_EXECUTORS; i++) {
        HTL_thread_scheduler_free(&scheduler[i]);
    }