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

This function un-initializes a job.

This function will destroy a job created with IotTaskPool_CreateRecyclableJob. A job should not be destroyed twice. A job that was previously scheduled but has not completed yet should not be destroyed, but rather the application should attempt to cancel it first by calling IotTaskPool_TryCancel. An attempt to destroy a job that was scheduled but not yet executed or canceled, may result in a IOT_TASKPOOL_ILLEGAL_OPERATION error.

Parameters
[in]taskPoolA handle to the task pool, e.g. as returned by a call to IotTaskPool_Create or IotTaskPool_CreateSystemTaskPool.
[in]jobA handle to a job that was create with a call to IotTaskPool_CreateJob.
Returns
One of the following:
Warning
The task pool will try and prevent destroying jobs that are currently queued for execution, but does not enforce strict ordering of operations. It is up to the user to make sure IotTaskPool_DestroyRecyclableJob is not called our of order.
Calling this function on job that was not previously created with IotTaskPool_CreateRecyclableJob will result in a IOT_TASKPOOL_ILLEGAL_OPERATION error.