AWS IoT Device SDK C: Task Pool
Task pool library
Return to main page ↑
IotTaskPool_RecycleJob

Recycles a job into the task pool job cache.

This function will try and recycle the job into the task pool cache. If the cache is full, the job memory is destroyed as if the user called IotTaskPool_DestroyRecyclableJob. The job should be recycled into the task pool instance from where it was allocated. Failure to do so will yield undefined results. A job should not be recycled twice. A job that was previously scheduled but not completed or canceled cannot be safely recycled. An attempt to do so will result in an IOT_TASKPOOL_ILLEGAL_OPERATION error.

Parameters
[in]taskPoolA handle to the task pool, e.g. as returned by a call to IotTaskPool_Create.
[out]jobA pointer to a job that was create with a call to IotTaskPool_CreateJob.
Returns
One of the following:
Warning
The taskPool used in this function should be the same used to create the job pointed to by job, or the results will be undefined.
Attempting to call this function on a statically allocated job will result in IOT_TASKPOOL_ILLEGAL_OPERATION error.
This function should be used to recycle a job in the task pool cache when after the job executed. Failing to call either this function or IotTaskPool_DestroyRecyclableJob will result is a memory leak. Statically allocated jobs do not need to be recycled or destroyed.