A synchronized queue. More...
#include <XrdClJobManager.hh>
Classes | |
struct | JobHelper |
Public Member Functions | |
JobManager (uint32_t workers) | |
Constructor. | |
~JobManager () | |
Destructor. | |
bool | Initialize () |
Initialize the job manager. | |
bool | Finalize () |
Finalize the job manager, clear the queues. | |
bool | Start () |
Start the workers. | |
bool | Stop () |
Stop the workers. | |
void | QueueJob (Job *job, void *arg=0) |
Add a job to be run. | |
void | RunJobs () |
Run the jobs. | |
bool | IsWorker () |
Private Member Functions | |
void | StopWorkers (uint32_t n) |
Stop all workers up to n'th. | |
Private Attributes | |
std::vector< pthread_t > | pWorkers |
SyncQueue< JobHelper > | pJobs |
XrdSysMutex | pMutex |
bool | pRunning |
A synchronized queue.
XrdCl::JobManager::JobManager | ( | uint32_t | workers | ) | [inline] |
XrdCl::JobManager::~JobManager | ( | ) | [inline] |
Destructor.
bool XrdCl::JobManager::Finalize | ( | ) |
Finalize the job manager, clear the queues.
bool XrdCl::JobManager::Initialize | ( | ) |
Initialize the job manager.
bool XrdCl::JobManager::IsWorker | ( | ) | [inline] |
References pWorkers.
void XrdCl::JobManager::QueueJob | ( | Job * | job, | |
void * | arg = 0 | |||
) | [inline] |
Add a job to be run.
References pJobs, and XrdCl::SyncQueue< Item >::Put().
void XrdCl::JobManager::RunJobs | ( | ) |
Run the jobs.
bool XrdCl::JobManager::Start | ( | ) |
Start the workers.
bool XrdCl::JobManager::Stop | ( | ) |
Stop the workers.
void XrdCl::JobManager::StopWorkers | ( | uint32_t | n | ) | [private] |
Stop all workers up to n'th.
SyncQueue<JobHelper> XrdCl::JobManager::pJobs [private] |
Referenced by QueueJob().
XrdSysMutex XrdCl::JobManager::pMutex [private] |
bool XrdCl::JobManager::pRunning [private] |
Referenced by JobManager().
std::vector<pthread_t> XrdCl::JobManager::pWorkers [private] |
Referenced by IsWorker(), and JobManager().