alf_task_event_handler_register - Allows you to register and unregister an event handler for a specific task.
int alf_task_event_handler_register (alf_task_handle_t task_handle, int (*task_event_handler)( alf_task_handle_t task_handle, ALF_TASK_EVENT_TYPE_T event, void* p_data), void* p_data, unsigned int data_size, unsigned int event_mask);
Parameters | |
task_handle [IN] | The handle to a task. |
task_event_handler [IN] | Pointer of the event handler function for the specified task. A NULL value indicates the current event handler is to be unregistered. |
p_context [IN] | A pointer to a context buffer that is copied to another buffer managed by the ALF runtime. The pointer to this buffer is passed to the event handler. The content of the context buffer is copied by value only. A NULL value indicates no context buffer. |
context_size [IN] | The size of the context buffer in bytes. Zero indicates no context buffer. |
event_mask [IN] | A bitwise OR of ALF_TASK_EVENT_TYPE_T values. ALF_TASK_EVENT_TYPE_T is
defined as follows:
|
This function allows you to register an event handler for a specified task. This function can only be called before alf_task_finalize is invoked. An error is returned if a you try to register an event handler for a task that has been finalized.
If the task_event_handler function is NULL, this function unregisters the current event handler. If there is no current event handler, nothing happens.
0 | Success |
less than 0 | Errors occurred:
|