XrdCl::TaskManager Class Reference

#include <XrdClTaskManager.hh>

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

List of all members.

Classes

struct  TaskHelper
struct  TaskHelperCmp

Public Member Functions

 TaskManager ()
 Constructor.
 ~TaskManager ()
 Destructor.
bool Start ()
 Start the manager.
bool Stop ()
void RegisterTask (Task *task, time_t time, bool own=true)
void UnregisterTask (Task *task)
void RunTasks ()
 Run the tasks - this loops infinitely.

Private Types

typedef std::multiset
< TaskHelper, TaskHelperCmp
TaskSet
typedef std::list< Task * > TaskList

Private Attributes

uint16_t pResolution
TaskSet pTasks
TaskList pToBeUnregistered
pthread_t pRunnerThread
bool pRunning
XrdSysMutex pMutex
XrdSysMutex pOpMutex

Detailed Description

Run short tasks at a given time in the future

The task manager just runs one extra thread so the execution of one tasks may interfere with the execution of another


Member Typedef Documentation

typedef std::list<Task*> XrdCl::TaskManager::TaskList [private]
typedef std::multiset<TaskHelper, TaskHelperCmp> XrdCl::TaskManager::TaskSet [private]

Constructor & Destructor Documentation

XrdCl::TaskManager::TaskManager (  ) 

Constructor.

XrdCl::TaskManager::~TaskManager (  ) 

Destructor.


Member Function Documentation

void XrdCl::TaskManager::RegisterTask ( Task task,
time_t  time,
bool  own = true 
)

Run the given task at the given time.

Parameters:
task task to be run
time time at which the task should be run
own determines whether the task object should be destroyed when no longer needed
void XrdCl::TaskManager::RunTasks (  ) 

Run the tasks - this loops infinitely.

bool XrdCl::TaskManager::Start (  ) 

Start the manager.

bool XrdCl::TaskManager::Stop (  ) 

Stop the manager

Will wait until the currently running task completes

void XrdCl::TaskManager::UnregisterTask ( Task task  ) 

Remove a task, the unregistration process is asynchronous and may be performed at any point in the future, the function just queues the request. Unregistered task gets destroyed if it was owned by the task manager.


Member Data Documentation

uint16_t XrdCl::TaskManager::pResolution [private]
pthread_t XrdCl::TaskManager::pRunnerThread [private]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 11 Jun 2020 for xrootd by  doxygen 1.6.1