Task Pool API Reference
Task pool library
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.
IotTaskPool_t
struct _taskPool * IotTaskPool_t
Opaque handle of a Task Pool instance.
Definition: iot_taskpool_types.h:213
IotTaskPool_RecycleJob
IotTaskPoolError_t IotTaskPool_RecycleJob(IotTaskPool_t taskPool, IotTaskPoolJob_t job)
Recycles a job into the task pool job cache.
Definition: iot_taskpool.c:381
IotTaskPoolError_t
IotTaskPoolError_t
Return codes of task pool functions.
Definition: iot_taskpool_types.h:50
IotTaskPoolJob_t
struct _taskPoolJob * IotTaskPoolJob_t
Opaque handle of a Task Pool Job.
Definition: iot_taskpool_types.h:246