28 #ifndef IOT_TASKPOOL_H_ 29 #define IOT_TASKPOOL_H_ 32 #include "iot_config.h" 197 uint32_t maxThreads );
534 #ifndef IOT_TASKPOOLS 535 #define IOT_TASKPOOLS ( 4 ) 541 #ifndef IOT_TASKPOOL_JOBS_RECYCLE_LIMIT 542 #define IOT_TASKPOOL_JOBS_RECYCLE_LIMIT ( 8UL ) 550 #ifndef IOT_TASKPOOL_JOB_WAIT_TIMEOUT_MS 551 #define IOT_TASKPOOL_JOB_WAIT_TIMEOUT_MS ( 60 * 1000UL ) const char * IotTaskPool_strerror(IotTaskPoolError_t status)
Returns a string that describes an IotTaskPoolError_t.
Definition: iot_taskpool.c:895
IotTaskPoolJobStorage_t * IotTaskPool_GetJobStorageFromHandle(IotTaskPoolJob_t job)
Returns a pointer to the job storage from an instance of a job handle of type IotTaskPoolJob_t. This function is guaranteed to succeed for a valid job handle.
Definition: iot_taskpool.c:888
IotTaskPoolError_t IotTaskPool_TryCancel(IotTaskPool_t taskPool, IotTaskPoolJob_t job, IotTaskPoolJobStatus_t *const pStatus)
This function tries to cancel a job that was previously scheduled with IotTaskPool_Schedule.
Definition: iot_taskpool.c:851
IotTaskPoolError_t IotTaskPool_RecycleJob(IotTaskPool_t taskPool, IotTaskPoolJob_t job)
Recycles a job into the task pool job cache.
Definition: iot_taskpool.c:644
struct _taskPoolJob * IotTaskPoolJob_t
Opaque handle of a Task Pool Job.
Definition: iot_taskpool_types.h:190
IotTaskPoolError_t IotTaskPool_DestroyRecyclableJob(IotTaskPool_t taskPool, IotTaskPoolJob_t job)
This function un-initializes a job.
Definition: iot_taskpool.c:596
IotTaskPoolJobStatus_t
Status codes of task pool Job.
Definition: iot_taskpool_types.h:98
IotTaskPool_t IotTaskPool_GetSystemTaskPool(void)
Retrieves the one and only instance of a system task pool.
Definition: iot_taskpool.c:267
IotTaskPoolError_t IotTaskPool_GetStatus(IotTaskPool_t taskPool, IotTaskPoolJob_t job, IotTaskPoolJobStatus_t *const pStatus)
This function retrieves the current status of a job.
Definition: iot_taskpool.c:816
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:546
IotTaskPoolError_t IotTaskPool_CreateJob(IotTaskPoolRoutine_t userCallback, void *pUserContext, IotTaskPoolJobStorage_t *const pJobStorage, IotTaskPoolJob_t *const pJob)
Creates a job for the task pool around a user-provided storage.
Definition: iot_taskpool.c:524
struct _taskPool * IotTaskPool_t
Opaque handle of a Task Pool instance.
Definition: iot_taskpool_types.h:156
IotTaskPoolError_t
Return codes of task pool functions.
Definition: iot_taskpool_types.h:50
IotTaskPoolError_t IotTaskPool_SetMaxThreads(IotTaskPool_t taskPool, uint32_t maxThreads)
Sets the maximum number of threads for one instance of a task pool.
Definition: iot_taskpool.c:469
IotTaskPoolError_t IotTaskPool_ScheduleDeferred(IotTaskPool_t taskPool, IotTaskPoolJob_t job, uint32_t timeMs)
This function schedules a job created with IotTaskPool_CreateJob against the task pool pointed to by ...
Definition: iot_taskpool.c:730
The job storage data structure provides the storage for a statically allocated Task Pool Job instance...
Definition: iot_taskpool_types.h:166
Initialization information to create one task pool instance.
Definition: iot_taskpool_types.h:218
IotTaskPoolError_t IotTaskPool_Schedule(IotTaskPool_t taskPool, IotTaskPoolJob_t job, uint32_t flags)
This function schedules a job created with IotTaskPool_CreateJob or IotTaskPool_CreateRecyclableJob a...
Definition: iot_taskpool.c:691
IotTaskPoolError_t IotTaskPool_Create(const IotTaskPoolInfo_t *pInfo, IotTaskPool_t *const pTaskPool)
Creates one instance of a task pool.
Definition: iot_taskpool.c:289
IotTaskPoolError_t IotTaskPool_CreateSystemTaskPool(const IotTaskPoolInfo_t *pInfo)
Creates the one single instance of the system task pool.
Definition: iot_taskpool.c:274
void(* IotTaskPoolRoutine_t)(IotTaskPool_t pTaskPool, IotTaskPoolJob_t pJob, void *pUserContext)
Callback type for a user callback.
Definition: iot_taskpool_types.h:203
IotTaskPoolError_t IotTaskPool_Destroy(IotTaskPool_t taskPool)
Destroys a task pool instance and collects all memory associated with a task pool and its satellite d...
Definition: iot_taskpool.c:333