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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user