82 std::vector<std::unique_ptr<CPLWorkerThread>> aWT{};
84 std::condition_variable m_cv{};
85 volatile CPLWorkerThreadState eState = CPLWTS_OK;
89 CPLList *psWaitingWorkerThreadsList =
nullptr;
90 int nWaitingWorkerThreads = 0;
92 int m_nMaxThreads = 0;
94 static void WorkerThreadFunction(
void *user_data);
96 void DeclareJobFinished();
97 CPLWorkerThreadJob *GetNextJob(CPLWorkerThread *psWorkerThread);
103 bool Setup(
int nThreads, CPLThreadFunc pfnInitFunc,
void **pasInitData);
104 bool Setup(
int nThreads, CPLThreadFunc pfnInitFunc,
void **pasInitData,
105 bool bWaitallStarted);
107 std::unique_ptr<CPLJobQueue> CreateJobQueue();
109 bool SubmitJob(CPLThreadFunc pfnFunc,
void *pData);
110 bool SubmitJobs(CPLThreadFunc pfnFunc,
const std::vector<void *> &apData);
111 void WaitCompletion(
int nMaxRemainingJobs = 0);
117 return m_nMaxThreads;
CPLWorkerThreadPool * GetPool()
Return the owning worker thread pool.
Definition cpl_worker_thread_pool.h:143
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition cpl_port.h:1042