xrootd
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdCl::JobManager Class Reference

A synchronized queue. More...

#include <XrdClJobManager.hh>

Collaboration diagram for XrdCl::JobManager:
Collaboration graph
[legend]

Classes

struct  JobHelper
 

Public Member Functions

 JobManager (uint32_t workers)
 Constructor. More...
 
 ~JobManager ()
 Destructor. More...
 
bool Initialize ()
 Initialize the job manager. More...
 
bool Finalize ()
 Finalize the job manager, clear the queues. More...
 
bool Start ()
 Start the workers. More...
 
bool Stop ()
 Stop the workers. More...
 
void QueueJob (Job *job, void *arg=0)
 Add a job to be run. More...
 
void RunJobs ()
 Run the jobs. More...
 
bool IsWorker ()
 

Private Member Functions

void StopWorkers (uint32_t n)
 Stop all workers up to n'th. More...
 

Private Attributes

std::vector< pthread_t > pWorkers
 
SyncQueue< JobHelperpJobs
 
XrdSysMutex pMutex
 
bool pRunning
 

Detailed Description

A synchronized queue.

Constructor & Destructor Documentation

XrdCl::JobManager::JobManager ( uint32_t  workers)
inline

Constructor.

References pRunning, and pWorkers.

XrdCl::JobManager::~JobManager ( )
inline

Destructor.

Member Function Documentation

bool XrdCl::JobManager::Finalize ( )

Finalize the job manager, clear the queues.

Referenced by XrdEc::ThreadPool::~ThreadPool().

bool XrdCl::JobManager::Initialize ( )

Initialize the job manager.

Referenced by XrdEc::ThreadPool::ThreadPool().

bool XrdCl::JobManager::IsWorker ( )
inline

References pWorkers.

void XrdCl::JobManager::QueueJob ( Job job,
void *  arg = 0 
)
inline
void XrdCl::JobManager::RunJobs ( )

Run the jobs.

bool XrdCl::JobManager::Start ( )

Start the workers.

Referenced by XrdEc::ThreadPool::ThreadPool().

bool XrdCl::JobManager::Stop ( )

Stop the workers.

Referenced by XrdEc::ThreadPool::~ThreadPool().

void XrdCl::JobManager::StopWorkers ( uint32_t  n)
private

Stop all workers up to n'th.

Member Data Documentation

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().


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