alf_task_depends_on

NAME

alf_task_depends_on - Describes a relationship between two tasks.

SYNOPSIS

int alf_task_depends_on (alf_task_handle_t task_handle_dependent, alf_task_handle_t task_handle);

Parameters  
task_handle_dependent [IN] The handle to the dependent task
task_handle [IN] The handle to a task

DESCRIPTION

This function describes a relationship between two tasks. The task specified by task_handle_dependent cannot be scheduled to run until the task specified by task_handle has run to finish normally. When this API is called, task_handle must not be an explicitly destroyed task. An error is reported if it is the case. If the task associated with task_handle is destroyed before normal completion, the task_handle_dependent is also destroyed because its dependency can no longer be satisfied.

If task A depends on task B, a call to alf_task_wait (A_handle) effectively enforces a wait on task B as well. A duplicate dependency is handled silently and not treated as an error.

Refer to Task dependency and task scheduling for more information on task dependency and limitations on when the task dependencies can be set.

Note: This function can only be called before any work blocks are enqueued to the task_handle_dependent and before the task_handle_dependent is finalized. For the task_handle, these constraint is not applicable.

Whenever a situation occurs that is not permitted, the function returns ALF_ERR_PERM.

RETURN VALUE

0 Success
less than 0 Errors occurred:
  • ALF_ERR_BADF: Invalid task handle.
  • ALF_ERR_PERM: The API call is not permitted at the current context. For example, the dependency cannot be set because of the current state of the task.
  • 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_destroy
alf_task_event_handler_register