diff options
Diffstat (limited to 'contrib/zstd/pool.h')
-rw-r--r-- | contrib/zstd/pool.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/contrib/zstd/pool.h b/contrib/zstd/pool.h index 7dcaf010d..14e883feb 100644 --- a/contrib/zstd/pool.h +++ b/contrib/zstd/pool.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the @@ -16,11 +16,8 @@ extern "C" { #endif -#include <stddef.h> /* size_t */ - -#ifndef ZSTD_STATIC_LINKING_ONLY +#include "zstd_deps.h" #define ZSTD_STATIC_LINKING_ONLY /* ZSTD_customMem */ -#endif #include "zstd.h" typedef struct POOL_ctx_s POOL_ctx; @@ -41,6 +38,12 @@ POOL_ctx* POOL_create_advanced(size_t numThreads, size_t queueSize, */ void POOL_free(POOL_ctx* ctx); + +/*! POOL_joinJobs() : + * Waits for all queued jobs to finish executing. + */ +void POOL_joinJobs(POOL_ctx* ctx); + /*! POOL_resize() : * Expands or shrinks pool's number of threads. * This is more efficient than releasing + creating a new context, @@ -56,7 +59,7 @@ int POOL_resize(POOL_ctx* ctx, size_t numThreads); * @return threadpool memory usage * note : compatible with NULL (returns 0 in this case) */ -size_t POOL_sizeof(POOL_ctx* ctx); +size_t POOL_sizeof(const POOL_ctx* ctx); /*! POOL_function : * The function type that can be added to a thread pool. @@ -73,7 +76,7 @@ void POOL_add(POOL_ctx* ctx, POOL_function function, void* opaque); /*! POOL_tryAdd() : - * Add the job `function(opaque)` to thread pool _if_ a worker is available. + * Add the job `function(opaque)` to thread pool _if_ a queue slot is available. * Returns immediately even if not (does not block). * @return : 1 if successful, 0 if not. */ |