Task Pool API Reference
Task pool library
iot_taskpool_internal.h File Reference

Internal header of task pool library. This header should not be included in typical application code. More...

#include "iot_config.h"
#include "private/iot_error.h"
#include "iot_taskpool.h"
#include "FreeRTOS.h"
#include "semphr.h"
#include "timers.h"
#include "iot_logging_setup.h"
#include "private/iot_static_memory.h"

Go to the source code of this file.

Data Structures

struct  _taskPoolCache_t
 Task pool jobs cache. More...
 
struct  _taskPool_t
 The task pool data structure keeps track of the internal state and the signals for the dispatcher threads. The task pool is a thread safe data structure. More...
 
struct  _taskPoolJob_t
 The job data structure keeps track of the user callback and context, as well as the status of the job. More...
 
struct  _taskPoolTimerEvent_t
 Represents an operation that is subject to a timer. More...
 

Macros

#define TASKPOOL_SUCCEEDED(x)   ( ( x ) == IOT_TASKPOOL_SUCCESS )
 Every public API return an enumeration value with an undelying value of 0 in case of success.
 
#define TASKPOOL_FAILED(x)   ( ( x ) != IOT_TASKPOOL_SUCCESS )
 Every public API returns an enumeration value with an undelying value different than 0 in case of success.
 
#define TASKPOOL_GOTO_CLEANUP()   IOT_GOTO_CLEANUP()
 Jump to the cleanup area.
 
#define TASKPOOL_FUNCTION_ENTRY(result)   IOT_FUNCTION_ENTRY( IotTaskPoolError_t, result )
 Declare the storage for the error status variable.
 
#define TASKPOOL_ON_ERROR_GOTO_CLEANUP(expr)
 Check error and leave in case of failure. More...
 
#define TASKPOOL_ON_NULL_ARG_GOTO_CLEANUP(ptr)   IOT_VALIDATE_PARAMETER( IOT_TASKPOOL, ( ptr != NULL ) )
 Exit if an argument is NULL.
 
#define TASKPOOL_ON_ARG_ERROR_GOTO_CLEANUP(expr)   IOT_VALIDATE_PARAMETER( IOT_TASKPOOL, ( ( expr ) == false ) )
 Exit if an argument is NULL.
 
#define TASKPOOL_SET_AND_GOTO_CLEANUP(expr)   IOT_SET_AND_GOTO_CLEANUP( expr )
 Set error and leave.
 
#define TASKPOOL_FUNCTION_CLEANUP()   IOT_FUNCTION_CLEANUP_BEGIN()
 Initialize error and declare start of cleanup area.
 
#define TASKPOOL_FUNCTION_CLEANUP_END()   IOT_FUNCTION_CLEANUP_END()
 Initialize error and declare end of cleanup area.
 
#define TASKPOOL_NO_FUNCTION_CLEANUP()   IOT_FUNCTION_EXIT_NO_CLEANUP()
 Create an empty cleanup area.
 
#define TASKPOOL_NO_FUNCTION_CLEANUP_NOLABEL()   return status
 Does not create a cleanup area.
 
#define IotTaskPool_Assert(expression)
 Assertion macro for the Task pool library. More...
 

Functions

void * IotTaskPool_MallocJob (size_t size)
 Allocate an IotTaskPoolJob_t. This function should have the same signature as [malloc].
 
void IotTaskPool_FreeJob (void *ptr)
 Free an IotTaskPoolJob_t. This function should have the same same signature as [malloc]. (http://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html).
 
void * IotTaskPool_MallocTimerEvent (size_t size)
 Allocate an _taskPoolTimerEvent_t. This function should have the same signature as [malloc].
 
void IotTaskPool_FreeTimerEvent (void *ptr)
 Free an _taskPoolTimerEvent_t. This function should have the same signature as[ free ].
 

Detailed Description

Internal header of task pool library. This header should not be included in typical application code.

Macro Definition Documentation

◆ TASKPOOL_ON_ERROR_GOTO_CLEANUP

#define TASKPOOL_ON_ERROR_GOTO_CLEANUP (   expr)
Value:
{ if( TASKPOOL_FAILED( status = ( expr ) ) ) { IOT_GOTO_CLEANUP(); } \
}

Check error and leave in case of failure.

◆ IotTaskPool_Assert

#define IotTaskPool_Assert (   expression)

Assertion macro for the Task pool library.

Set IOT_TASKPOOL_ENABLE_ASSERTS to 1 to enable assertions in the Task pool library.

Parameters
[in]expressionExpression to be evaluated.
TASKPOOL_FAILED
#define TASKPOOL_FAILED(x)
Every public API returns an enumeration value with an undelying value different than 0 in case of suc...
Definition: iot_taskpool_internal.h:57