alf_exit

NAME

alf_exit - Shuts down the ALF runtime.

SYNOPSIS

int alf_exit(alf_handle_t alf_handle, ALF_EXIT_POLICY_T policy, int timeout);

Parameters  
alf_handle [IN] The ALF handle
policy [IN] Defines the shutdown behavior:
  • ALF_EXIT_POLICY_FORCE: Performs a shutdown immediately and stops all unfinished tasks if there are any.
  • ALF_EXIT_POLICY_WAIT: Waits for all tasks to be processed and then shuts down.
  • ALF_EXIT_POLICY_TRY: Returns with a failure if there are unfinished tasks.
time_out [IN] A timeout value that has the following values:
  • > 0 : Wait at most the specified milliseconds before a timeout error happens or a forced shutdown
  • = 0 : Shutdown or return without wait
  • less than 0 : Waits forever, only valid with ALF_EXIT_POLICY_WAIT

DESCRIPTION

This function shuts down the ALF runtime. It frees allocated accelerator resources and stops all running or pending work queues and tasks, depending on the policy parameter.

RETURN VALUE

>= 0 The shutdown succeeded. The number of unfinished work blocks is returned.
less than 0 The shutdown failed:
  • ALF_ERR_INVAL: Invalid input argument
  • ALF_ERR_BADF: Invalid ALF handle
  • ALF_ERR_PERM: The API call is not permitted at the current context
  • ALF_ERR_NOSYS: The required policy is not supported
  • ALF_ERR_TIME: Timeout
  • ALF_ERR_BUSY: There are tasks still running
  • ALF_ERR_GENERIC: Generic internal errors
Related reference
alf_handle_t
alf_init
alf_query_system_info
alf_num_instances_set
alf_error_handler_register
ALF_ERR_POLICY_T