xrootd
|
#include <XrdClTaskManager.hh>
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 |
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
|
private |
|
private |
XrdCl::TaskManager::TaskManager | ( | ) |
Constructor.
XrdCl::TaskManager::~TaskManager | ( | ) |
Destructor.
void XrdCl::TaskManager::RegisterTask | ( | Task * | task, |
time_t | time, | ||
bool | own = true |
||
) |
Run the given task at the given time.
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.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |