thrFreeFun

Register a function to delete a job data structure

Description:

This function can be used to register a function that will be called by the thr library to delete a job data structure once a job has completed. In this context, a " job data structure" is the data structure passed to thrAddJob when a job is submitted to the workforce. The registered function will be called to delete the job data structure only if the THR__FREE_JOBDATA flag is specified when the job was submitted to the workforce using thrAddJob. If no function is registered, the astFree function will be used by default. This is only appropriate if the data structure does not contain any dynamically allocated arrays or other resources that need to be released before freeing the structure.

The specified function, or astFree if no function is specified, is called from within the worker thread.

Invocation

void ∗(∗thrFreeFun( void ∗(∗freejob)( void ∗, int ∗) ))( void ∗, int ∗ )

Arguments

freejob
Pointer to the function to be called to free a job data structure. It should take two arguments - a " void ∗" pointer to the structure to be freed and an " int ∗" pointer to the inherited status value. It should always return a NULL pointer. If NULL is supplied FOR the function pointer (or if this function has not been called), then astFree will be used to free job data structures.

Returned Value

The pointer to the previously registered function, or NULL if no
function is currently registered.