32 using namespace XrdCl;
73 for( uint32_t i = 0; i < pWorkers.size(); ++i )
86 log->
Debug(
JobMgrMsg,
"Job manager started, %zu workers", pWorkers.size() );
104 StopWorkers( pWorkers.size() );
114 void JobManager::StopWorkers( uint32_t n )
117 for( uint32_t i = 0; i < n; ++i )
121 int rc = pthread_cancel( pWorkers[i] );
126 if( rc == ESRCH )
continue;
130 rc = pthread_join( pWorkers[i], (
void**)&threadRet );
135 if( rc == ESRCH )
continue;
148 pthread_setcanceltype( PTHREAD_CANCEL_DEFERRED, 0 );
151 JobHelper h = pJobs.
Get();
152 pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, 0 );
154 pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, 0 );
static void * RunRunnerThread(void *arg)
const char * XrdSysE2T(int errcode)
static Log * GetLog()
Get default log.
bool Finalize()
Finalize the job manager, clear the queues.
bool Start()
Start the workers.
bool Initialize()
Initialize the job manager.
void RunJobs()
Run the jobs.
bool Stop()
Stop the workers.
void Error(uint64_t topic, const char *format,...)
Report an error.
void Dump(uint64_t topic, const char *format,...)
Print a dump message.
void Debug(uint64_t topic, const char *format,...)
Print a debug message.
void Clear()
Clear the queue.
Item Get()
Get the item from the front of the queue.
const uint64_t TaskMgrMsg