Zrythm
a highly automated and intuitive digital audio workstation
|
Thread-safe object pool implementation. More...
Go to the source code of this file.
Data Structures | |
struct | ObjectPool |
Typedefs | |
typedef void *(* | ObjectCreatorFunc) (void) |
Function to call to create the objects in the pool. | |
Functions | |
ObjectPool * | object_pool_new (ObjectCreatorFunc create_func, ObjectFreeFunc free_func, int max_objects) |
Creates a new object pool. | |
void * | object_pool_get (ObjectPool *self) |
Returns an available object. | |
int | object_pool_get_num_available (ObjectPool *self) |
Returns the number of available objects. | |
void | object_pool_return (ObjectPool *self, void *object) |
Puts an object back in the pool. | |
void | object_pool_free (ObjectPool *self) |
Frees the pool and all its objects. | |
Thread-safe object pool implementation.
Definition in file object_pool.h.
typedef void *(* ObjectCreatorFunc) (void) |
Function to call to create the objects in the pool.
Definition at line 21 of file object_pool.h.
int object_pool_get_num_available | ( | ObjectPool * | self | ) |
Returns the number of available objects.