Task Pool API Reference
Task pool library
|
Go to the documentation of this file.
31 #ifndef IOT_TASKPOOL_H_
32 #define IOT_TASKPOOL_H_
35 #include "iot_config.h"
199 uint32_t maxThreads );
536 #ifndef IOT_TASKPOOLS
537 #define IOT_TASKPOOLS ( 4 )
543 #ifndef IOT_TASKPOOL_JOBS_RECYCLE_LIMIT
544 #define IOT_TASKPOOL_JOBS_RECYCLE_LIMIT ( 8UL )
552 #ifndef IOT_TASKPOOL_JOB_WAIT_TIMEOUT_MS
553 #define IOT_TASKPOOL_JOB_WAIT_TIMEOUT_MS ( 60 * 1000UL )
void(* IotTaskPoolRoutine_t)(IotTaskPool_t pTaskPool, IotTaskPoolJob_t pJob, void *pUserContext)
Callback type for a user callback.
Definition: iot_taskpool_types.h:259
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....
Definition: iot_taskpool.c:582
const char * IotTaskPool_strerror(IotTaskPoolError_t status)
Returns a string that describes an IotTaskPoolError_t.
Definition: iot_taskpool.c:589
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:550
struct _taskPool * IotTaskPool_t
Opaque handle of a Task Pool instance.
Definition: iot_taskpool_types.h:213
IotTaskPoolError_t IotTaskPool_RecycleJob(IotTaskPool_t taskPool, IotTaskPoolJob_t job)
Recycles a job into the task pool job cache.
Definition: iot_taskpool.c:381
IotTaskPoolJobStatus_t
Status codes of task pool Job.
Definition: iot_taskpool_types.h:156
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:520
IotTaskPoolError_t IotTaskPool_DestroyRecyclableJob(IotTaskPool_t taskPool, IotTaskPoolJob_t job)
This function un-initializes a job.
Definition: iot_taskpool.c:351
Initialization information to create one task pool instance.
Definition: iot_taskpool_types.h:273
IotTaskPoolError_t IotTaskPool_CreateSystemTaskPool(const IotTaskPoolInfo_t *const pInfo)
Creates the one single instance of the system task pool.
Definition: iot_taskpool.c:255
IotTaskPool_t IotTaskPool_GetSystemTaskPool(void)
Retrieves the one and only instance of a system task pool.
IotTaskPoolError_t IotTaskPool_Create(const IotTaskPoolInfo_t *const pInfo, IotTaskPool_t *const pTaskPool)
Creates one instance of a task pool.
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:281
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
The job storage data structure provides the storage for a statically allocated Task Pool Job instance...
Definition: iot_taskpool_types.h:223
IotTaskPoolError_t IotTaskPool_SetMaxThreads(IotTaskPool_t taskPool, uint32_t maxThreads)
Sets the maximum number of threads for one instance of a task pool.
IotTaskPoolError_t
Return codes of task pool functions.
Definition: iot_taskpool_types.h:50
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:451
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:414
struct _taskPoolJob * IotTaskPoolJob_t
Opaque handle of a Task Pool Job.
Definition: iot_taskpool_types.h:246
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...