GDAL
Public Member Functions | List of all members
CPLJobQueue Class Reference

Job queue. More...

#include <cpl_worker_thread_pool.h>

Public Member Functions

CPLWorkerThreadPoolGetPool ()
 Return the owning worker thread pool.
 
bool SubmitJob (CPLThreadFunc pfnFunc, void *pData)
 Queue a new job. More...
 
bool SubmitJob (std::function< void()> task)
 Queue a new job. More...
 
void WaitCompletion (int nMaxRemainingJobs=0)
 Wait for completion of part or whole jobs. More...
 
bool WaitEvent ()
 Wait for completion for at least one job. More...
 

Detailed Description

Job queue.

Member Function Documentation

◆ SubmitJob() [1/2]

bool CPLJobQueue::SubmitJob ( CPLThreadFunc  pfnFunc,
void *  pData 
)

Queue a new job.

Parameters
pfnFuncFunction to run for the job.
pDataUser data to pass to the job function.
Returns
true in case of success.

◆ SubmitJob() [2/2]

bool CPLJobQueue::SubmitJob ( std::function< void()>  task)

Queue a new job.

Parameters
taskTask to execute.
Returns
true in case of success.

◆ WaitCompletion()

void CPLJobQueue::WaitCompletion ( int  nMaxRemainingJobs = 0)

Wait for completion of part or whole jobs.

Parameters
nMaxRemainingJobsMaximum number of pendings jobs that are allowed in the queue after this method has completed. Might be 0 to wait for all jobs.

◆ WaitEvent()

bool CPLJobQueue::WaitEvent ( )

Wait for completion for at least one job.

Returns
true if there are remaining jobs.

The documentation for this class was generated from the following files: