199 } values;
void fiftyoneDegreesPoolFree(fiftyoneDegreesPool *pool)
Releases the items used by the pool freeing the resources used by each item by calling the resourceFr...
fiftyoneDegreesPoolItem * fiftyoneDegreesPoolItemGet(fiftyoneDegreesPool *pool, fiftyoneDegreesException *exception)
Gets the next free item from the pool for exclusive use by the caller.
void fiftyoneDegreesPoolItemRelease(fiftyoneDegreesPoolItem *item)
Releases the item back to the pool it belongs ready to be reused by another operation.
void(* fiftyoneDegreesPoolResourceFree)(fiftyoneDegreesPool *pool, void *resource)
Frees a resource previously created with fiftyoneDegreesPoolResourceCreate.
Definition pool.h:178
size_t(* fiftyoneDegreesPoolResourceSize)(void *state)
Used to determine the additional size beyond the pointer used for each resource added to the pool.
Definition pool.h:171
void *(* fiftyoneDegreesPoolResourceCreate)(fiftyoneDegreesPool *pool, void *state, fiftyoneDegreesException *exception)
Used to create a new resource for use in the pool.
Definition pool.h:159
void fiftyoneDegreesPoolReset(fiftyoneDegreesPool *pool)
Resets the pool without releasing any resources.
fiftyoneDegreesPool * fiftyoneDegreesPoolInit(fiftyoneDegreesPool *pool, uint16_t concurrency, void *state, fiftyoneDegreesPoolResourceCreate resourceCreate, fiftyoneDegreesPoolResourceFree resourceFree, fiftyoneDegreesException *exception)
Initialises a pool data structure to support the number of concurrent requests that can be made to th...
pthread_mutex_t fiftyoneDegreesMutex
MUTEX AND THREADING MACROS.
Definition threading.h:112
Structure used to represent a 51Degrees exception and passed into methods that might generate excepti...
Definition exceptions.h:115
fiftyoneDegreesMutex lock
Guards the count and the wait for an item.
Definition pool.h:214
fiftyoneDegreesPoolItem * stack
Pointer to the memory used by the stack.
Definition pool.h:206
fiftyoneDegreesPoolResourceFree resourceFree
Frees a resource.
Definition pool.h:210
volatile long waiting
Number of threads waiting for an item.
Definition pool.h:212
uint16_t count
Number of resource items that stack can hold.
Definition pool.h:209
void * resource
Pointer to the resource in the pool.
Definition pool.h:186
fiftyoneDegreesPool * pool
Reader the handle belongs to.
Definition pool.h:188
volatile long exchange
Number used in the compare exchange operation.
Definition pool.h:195
uint16_t aba
ABA value used to ensure proper operation.
Definition pool.h:198
uint16_t index
Index of the item in the linked list.
Definition pool.h:197
