|
xrootd
|
#include <XrdClTaskManager.hh>

Classes | |
| struct | TaskHelper |
| struct | TaskHelperCmp |
Public Member Functions | |
| TaskManager () | |
| Constructor. More... | |
| ~TaskManager () | |
| Destructor. More... | |
| bool | Start () |
| Start the manager. More... | |
| bool | Stop () |
| void | RegisterTask (Task *task, time_t time) |
| void | UnregisterTask (Task *task) |
| void | RunTasks () |
| Run the tasks - this loops infinitely. More... | |
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 taks may interfere with the execution of another
|
private |
|
private |
| XrdCl::TaskManager::TaskManager | ( | ) |
Constructor.
| XrdCl::TaskManager::~TaskManager | ( | ) |
Destructor.
References pTasks.
| void XrdCl::TaskManager::RegisterTask | ( | Task * | task, |
| time_t | time | ||
| ) |
Run the given task at the given time, the manager takes ownership over the task and will destroy it when no longer necessary
| task | task to be run |
| time | time at which the task schould be run |
References XrdCl::Log::Debug(), XrdCl::DefaultEnv::GetLog(), XrdCl::Task::GetName(), pMutex, pTasks, XrdCl::TaskMgrMsg, and XrdCl::Utils::TimeToString().
Referenced by XrdCl::Channel::Channel(), XrdCl::Stream::OnConnectError(), and XrdCl::XRootDMsgHandler::OnIncoming().
| void XrdCl::TaskManager::RunTasks | ( | ) |
Run the tasks - this loops infinitely.
References XrdCl::Log::Debug(), XrdCl::Log::Dump(), XrdCl::DefaultEnv::GetLog(), XrdCl::Task::GetName(), XrdSysMutex::Lock(), pMutex, pResolution, pTasks, pToBeUnregistered, XrdCl::TaskMgrMsg, XrdCl::Utils::TimeToString(), and XrdSysMutex::UnLock().
Referenced by RunRunnerThread().
| bool XrdCl::TaskManager::Start | ( | ) |
Start the manager.
References XrdCl::Log::Debug(), XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), pOpMutex, pRunnerThread, pRunning, RunRunnerThread(), and XrdCl::TaskMgrMsg.
Referenced by XrdCl::PostMaster::Start().
| bool XrdCl::TaskManager::Stop | ( | ) |
Stop the manager
Will wait until the currently running task completes
References XrdCl::Log::Debug(), XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), pOpMutex, pRunnerThread, pRunning, and XrdCl::TaskMgrMsg.
Referenced by XrdCl::PostMaster::Stop().
| 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.
References XrdCl::Log::Debug(), XrdCl::DefaultEnv::GetLog(), XrdCl::Task::GetName(), pMutex, pToBeUnregistered, and XrdCl::TaskMgrMsg.
Referenced by XrdCl::Channel::~Channel().
|
private |
Referenced by RegisterTask(), RunTasks(), and UnregisterTask().
|
private |
|
private |
Referenced by RunTasks().
|
private |
Referenced by RegisterTask(), RunTasks(), and ~TaskManager().
|
private |
Referenced by RunTasks(), and UnregisterTask().
1.8.3.1