MCPcopy Create free account
hub / github.com/F-Stack/f-stack / POOL_join

Function POOL_join

freebsd/contrib/zstd/lib/common/pool.c:165–178  ·  view source on GitHub ↗

! POOL_join() : Shutdown the queue, wake any sleeping threads, and join all of the threads. */

Source from the content-addressed store, hash-verified

163 Shutdown the queue, wake any sleeping threads, and join all of the threads.
164*/
165static void POOL_join(POOL_ctx* ctx) {
166 /* Shut down the queue */
167 ZSTD_pthread_mutex_lock(&ctx->queueMutex);
168 ctx->shutdown = 1;
169 ZSTD_pthread_mutex_unlock(&ctx->queueMutex);
170 /* Wake up sleeping threads */
171 ZSTD_pthread_cond_broadcast(&ctx->queuePushCond);
172 ZSTD_pthread_cond_broadcast(&ctx->queuePopCond);
173 /* Join all of the threads */
174 { size_t i;
175 for (i = 0; i < ctx->threadCapacity; ++i) {
176 ZSTD_pthread_join(ctx->threads[i], NULL); /* note : could fail */
177 } }
178}
179
180void POOL_free(POOL_ctx *ctx) {
181 if (!ctx) { return; }

Callers 1

POOL_freeFunction · 0.70

Calls 1

ZSTD_pthread_joinFunction · 0.85

Tested by

no test coverage detected