|
libcmutils 0.6.5
Multi-platform C99 utility library
|
Resource pool object. More...
Data Fields | |
| void *(* | CheckOut )(CMUTIL_Pool *pool, long millisec) |
| Check out a resource from the pool. | |
| void(* | Release )(CMUTIL_Pool *pool, void *resource) |
| Release a resource back to the pool. | |
| void(* | AddResource )(CMUTIL_Pool *pool, void *resource) |
| Add a new resource to the pool. | |
| void(* | Destroy )(CMUTIL_Pool *pool) |
| Destroy the resource pool and free its resources. | |
Resource pool object.
| void *(* CMUTIL_Pool::CheckOut) (CMUTIL_Pool *pool, long millisec) |
Check out a resource from the pool.
This function retrieves a resource from the pool, waiting up to the specified number of milliseconds if no resources are currently available.
| pool | The resource pool from which to check out a resource. |
| millisec | The maximum time to wait for a resource, in milliseconds. A value of 0 means to return immediately if no resources are available. A negative value means to wait indefinitely. |
| void(* CMUTIL_Pool::Release) (CMUTIL_Pool *pool, void *resource) |
Release a resource back to the pool.
This function returns a previously checked-out resource back to the pool for reuse.
| pool | The resource pool to which the resource will be released. |
| resource | The resource to be released back to the pool. |
| void(* CMUTIL_Pool::AddResource) (CMUTIL_Pool *pool, void *resource) |
Add a new resource to the pool.
This function adds a new resource to the pool, increasing the total number of resources managed by the pool.
| pool | The resource pool to which the resource will be added. |
| resource | The resource to be added to the pool. |
| void(* CMUTIL_Pool::Destroy) (CMUTIL_Pool *pool) |
Destroy the resource pool and free its resources.
This function releases all resources managed by the pool and frees any associated memory. After calling this function, the pool object should not be used again.
| pool | The resource pool to be destroyed. |