Task Pool API Reference
Task pool library
IotTaskPool_CreateRecyclableJob

Creates a job for the task pool by allocating the job dynamically.

IotTaskPoolRoutine_t userCallback,
void * pUserContext,
IotTaskPoolJob_t * const pJob );

A recyclable job does not need to be allocated twice, but it can rather be reused through subsequent calls to IotTaskPool_CreateRecyclableJob.

Parameters
[in]taskPoolA handle to the task pool for which to create a recyclable job.
[in]userCallbackA user-specified callback for the job.
[in]pUserContextA user-specified context for the callback.
[out]pJobA pointer to an instance of IotTaskPoolJob_t that will be initialized when this function returns successfully. This handle can be used to inspect the job status with IotTaskPool_GetStatus or cancel the job with IotTaskPool_TryCancel, etc....
Returns
One of the following:
Warning
A recyclable job should be recycled with a call to IotTaskPool_RecycleJob rather than destroyed.
IotTaskPoolRoutine_t
void(* IotTaskPoolRoutine_t)(IotTaskPool_t pTaskPool, IotTaskPoolJob_t pJob, void *pUserContext)
Callback type for a user callback.
Definition: iot_taskpool_types.h:259
IotTaskPool_t
struct _taskPool * IotTaskPool_t
Opaque handle of a Task Pool instance.
Definition: iot_taskpool_types.h:213
IotTaskPool_CreateRecyclableJob
IotTaskPoolError_t IotTaskPool_CreateRecyclableJob(IotTaskPool_t taskPool, IotTaskPoolRoutine_t userCallback, void *pUserContext, IotTaskPoolJob_t *const pJob)
Creates a job for the task pool by allocating the job dynamically.
Definition: iot_taskpool.c:303
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