finalized POOL_resize()

POOL_ctx* POOL_resize(POOL_ctx* ctx, size_t numThreads)

The function may fail, and returns a NULL pointer in this case.
This commit is contained in:
Yann Collet
2018-06-19 16:03:12 -07:00
parent 1c714fda3f
commit 4567c57199
2 changed files with 37 additions and 23 deletions
+10
View File
@@ -38,6 +38,16 @@ POOL_ctx* POOL_create_advanced(size_t numThreads, size_t queueSize,
*/
void POOL_free(POOL_ctx* ctx);
/*! POOL_resize() :
* Expands or shrinks pool's number of threads.
* This is more efficient than releasing and creating a new context.
* @return : a new pool context on success, NULL on failure
* note : new pool context might have same address as original one, but it's not guaranteed.
* consider starting context as consumed, only rely on returned one.
* note 2 : only numThreads can be resized, queueSize is unchanged.
*/
POOL_ctx* POOL_resize(POOL_ctx* ctx, size_t numThreads);
/*! POOL_sizeof() :
* @return threadpool memory usage
* note : compatible with NULL (returns 0 in this case)