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;
72 #endif // ndef DOXYGEN_SKIP
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();
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);
107 #endif // CPL_WORKER_THREAD_POOL_H_INCLUDED_
Definition: cpl_worker_thread_pool.h:53
int GetThreadCount() const
Definition: cpl_worker_thread_pool.h:104
Definition: cpl_worker_thread_pool.h:75
typedefCPL_C_START struct _CPLList CPLList
Definition: cpl_list.h:48
Definition: cpl_worker_thread_pool.h:47