30#ifndef CPL_WORKER_THREAD_POOL_H_INCLUDED_
31#define CPL_WORKER_THREAD_POOL_H_INCLUDED_
33#include "cpl_multiproc.h"
49 CPLThreadFunc pfnFunc;
55 CPLThreadFunc pfnInitFunc;
58 CPLJoinableThread *hThread;
71} CPLWorkerThreadState;
77 std::vector<CPLWorkerThread> aWT;
80 volatile CPLWorkerThreadState eState;
82 volatile int nPendingJobs;
84 CPLList* psWaitingWorkerThreadsList;
85 int nWaitingWorkerThreads;
87 static void WorkerThreadFunction(
void* user_data);
89 void DeclareJobFinished();
90 CPLWorkerThreadJob* GetNextJob(CPLWorkerThread* psWorkerThread);
96 bool Setup(
int nThreads,
97 CPLThreadFunc pfnInitFunc,
99 bool SubmitJob(CPLThreadFunc pfnFunc,
void* pData);
100 bool SubmitJobs(CPLThreadFunc pfnFunc,
const std::vector<void*>& apData);
101 void WaitCompletion(
int nMaxRemainingJobs = 0);
Definition: cpl_worker_thread_pool.h:76
int GetThreadCount() const
Definition: cpl_worker_thread_pool.h:104
Definition: cpl_list.h:52