![]() |
XRootD
|
#include <XrdClTaskManager.hh>
Public Member Functions | |
TaskManager () | |
Constructor. More... | |
~TaskManager () | |
Destructor. More... | |
void | RegisterTask (Task *task, time_t time, bool own=true) |
void | RunTasks () |
Run the tasks - this loops infinitely. More... | |
bool | Start () |
Start the manager. More... | |
bool | Stop () |
void | UnregisterTask (Task *task) |
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
Definition at line 75 of file XrdClTaskManager.hh.
XrdCl::TaskManager::TaskManager | ( | ) |
Constructor.
Definition at line 48 of file XrdClTaskManager.cc.
XrdCl::TaskManager::~TaskManager | ( | ) |
Destructor.
Definition at line 54 of file XrdClTaskManager.cc.
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 |
Definition at line 127 of file XrdClTaskManager.cc.
References XrdCl::Log::Debug(), XrdCl::DefaultEnv::GetLog(), XrdCl::Task::GetName(), XrdCl::TaskMgrMsg, and XrdCl::Utils::TimeToString().
Referenced by XrdCl::Channel::Channel(), XrdCl::ForkHandler::Child(), XrdCl::DefaultEnv::GetPostMaster(), XrdCl::Stream::OnConnectError(), and XrdCl::XRootDMsgHandler::Process().
void XrdCl::TaskManager::RunTasks | ( | ) |
Run the tasks - this loops infinitely.
Definition at line 153 of file XrdClTaskManager.cc.
References XrdCl::Log::Debug(), XrdCl::Log::Dump(), XrdCl::DefaultEnv::GetLog(), XrdCl::Task::GetName(), XrdSysMutex::Lock(), XrdCl::TaskMgrMsg, XrdCl::Utils::TimeToString(), XrdSysMutex::UnLock(), and XrdSysTimer::Wait().
Referenced by RunRunnerThread().
bool XrdCl::TaskManager::Start | ( | ) |
Start the manager.
Definition at line 65 of file XrdClTaskManager.cc.
References XrdCl::Log::Debug(), XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), RunRunnerThread(), XrdCl::TaskMgrMsg, and XrdSysE2T().
bool XrdCl::TaskManager::Stop | ( | ) |
Stop the manager
Will wait until the currently running task completes
Definition at line 92 of file XrdClTaskManager.cc.
References XrdCl::Log::Debug(), XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), XrdCl::TaskMgrMsg, and XrdSysE2T().
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.
Definition at line 141 of file XrdClTaskManager.cc.
References XrdCl::Log::Debug(), XrdCl::DefaultEnv::GetLog(), XrdCl::Task::GetName(), and XrdCl::TaskMgrMsg.