pool.h
void fiftyoneDegreesPoolReset(fiftyoneDegreesPool *pool)
Resets the pool without releasing any resources.
fiftyoneDegreesPoolResourceFree resourceFree
Frees a resource.
Definition: pool.h:204
void(* fiftyoneDegreesPoolResourceFree)(fiftyoneDegreesPool *pool, void *resource)
Frees a resource previously created with fiftyoneDegreesPoolResourceCreate.
Definition: pool.h:172
uint16_t index
Index of the item in the linked list.
Definition: pool.h:191
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:203
volatile long exchange
Number used in the compare exchange operation.
Definition: pool.h:189
uint16_t aba
ABA value used to ensure proper operation.
Definition: pool.h:192
fiftyoneDegreesPoolItem * stack
Pointer to the memory used by the stack.
Definition: pool.h:200
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:165
The head of the stack used for pop and push operations.
Definition: pool.h:188
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:180
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:153
Structure used to represent a 51Degrees exception and passed into methods that might generate excepti...
Definition: exceptions.h:116
fiftyoneDegreesPool * pool
Reader the handle belongs to.
Definition: pool.h:182