alf_task_destroy

NAME

alf_task_destroy - Destroys the specified task.

SYNOPSIS

int alf_task_destroy(alf_task_handle_t* p_task_handle)

Parameters  
task_handle [IN] The pointer to a task handle that is returned by the alf_create_task API.

DESCRIPTION

This function explicitly destroys the specified task if it is in pending or running state. If there are work blocks that are still not processed, this routine stops the execution of those work blocks. If a task is running when this API is invoked, the task is cancelled before the API returns. Resources associated with this task are recycled by the runtime either synchronously or asynchronously, depending on the runtime implementation. This API does nothing on an already completed task. If a task is destroyed explicitly, all tasks that depend on this task directly or indirectly are destroyed. Because ALF frees task resources automatically, it is not necessary to call this API to free up resources after a task has been run to complete normally. The API should only be used to explicitly end a task when you need to.

RETURN VALUE

0 Success
less than 0 Errors occurred:
  • ALF_ERR_INVAL: Invalid input argument.
  • ALF_ERR_BADF: Invalid task handle.
  • ALF_ERR_PERM: The API call is not permitted at current context.
  • ALF_ERR_BUSY: Resource busy.
  • ALF_ERR_SRCH: Already destroyed task handle.
  • ALF_ERR_GENERIC: Generic internal errors.
Related reference
alf_task_handle_t
alf_task_desc_handle_t
alf_task_desc_create
alf_task_desc_destroy
alf_task_desc_ctx_entry_add
alf_task_desc_set_int32
alf_task_desc_set_int64
alf_task_create
alf_task_finalize
alf_task_wait
alf_task_query
alf_task_depends_on
alf_task_event_handler_register