pool.h
void fiftyoneDegreesPoolReset(fiftyoneDegreesPool *pool)
Resets the pool without releasing any resources.
fiftyoneDegreesPoolResourceFree resourceFree
Frees a resource.
Definition: pool.h:203
void(* fiftyoneDegreesPoolResourceFree)(fiftyoneDegreesPool *pool, void *resource)
Frees a resource previously created with fiftyoneDegreesPoolResourceCreate.
Definition: pool.h:171
uint16_t index
Index of the item in the linked list.
Definition: pool.h:190
void fiftyoneDegreesPoolFree(fiftyoneDegreesPool *pool)
Releases the items used by the pool freeing the resources used by each item by calling the resourceFr...
uint16_t count
Number of resource items that stack can hold.
Definition: pool.h:202
volatile long exchange
Number used in the compare exchange operation.
Definition: pool.h:188
uint16_t aba
ABA value used to ensure proper operation.
Definition: pool.h:191
fiftyoneDegreesPoolItem * stack
Pointer to the memory used by the stack.
Definition: pool.h:199
fiftyoneDegreesPoolItem * fiftyoneDegreesPoolItemGet(fiftyoneDegreesPool *pool, fiftyoneDegreesException *exception)
Gets the next free item from the pool for exclusive use by the caller.
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:164
The head of the stack used for pop and push operations.
Definition: pool.h:187
void fiftyoneDegreesPoolItemRelease(fiftyoneDegreesPoolItem *item)
Releases the item back to the pool it belongs ready to be reused by another operation.
void * resource
Pointer to the resource in the pool.
Definition: pool.h:179
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...
void *(* fiftyoneDegreesPoolResourceCreate)(fiftyoneDegreesPool *pool, void *state, fiftyoneDegreesException *exception)
Used to create a new resource for use in the pool.
Definition: pool.h:152
Structure used to represent a 51Degrees exception and passed into methods that might generate excepti...
Definition: exceptions.h:111
fiftyoneDegreesPool * pool
Reader the handle belongs to.
Definition: pool.h:181