31 MsgStream log( messageSvc,
"ThreadInitTask" );
36 log <<
MSG::DEBUG <<
"execute() in thread 0x" << std::hex << pthread_self() <<
" at " <<
this << std::dec
40 log <<
MSG::WARNING <<
"thread initialization has already been done on thread " << std::hex << pthread_self()
48 log <<
MSG::ERROR <<
"unable to retrieve ToolHandleArray " << tools <<
endmsg;
52 if ( tools.
empty() ) {
56 if ( debug ) log <<
MSG::DEBUG <<
"executing in thread 0x" << std::hex << pthread_self() << std::dec <<
endmsg;
60 log <<
MSG::INFO <<
"Not calling terminateThread for thread 0x" << std::hex << pthread_self()
61 <<
" as it has not been initialized" <<
endmsg;
64 for (
auto& t : tools ) {
77 log <<
MSG::ERROR <<
"ThreadInitTool " << t <<
" in thread 0x" << std::hex << pthread_self() << std::dec
78 <<
" threw GaudiException: " << exc <<
endmsg;
80 }
catch (
const std::exception& exc ) {
81 log <<
MSG::ERROR <<
"ThreadInitTool " << t <<
" in thread 0x" << std::hex << pthread_self() << std::dec
82 <<
" threw std::exception: " << exc.
what() <<
endmsg;
85 log <<
MSG::ERROR <<
"ThreadInitTool " << t <<
" in thread 0x" << std::hex << pthread_self() << std::dec
86 <<
" threw unknown exception" <<
endmsg;
97 log <<
MSG::DEBUG <<
"waiting at barrier in thread 0x" << std::hex << pthread_self() << std::dec <<
endmsg;
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Define general base for Gaudi exception.
const char * what() const override
method from std::exception
StatusCode release() override
Release all tools.
StatusCode retrieve() override
Retrieve all tools.
bool empty() const override
Return whether the list of tools is empty.
Definition of the MsgStream class used to transmit messages.
Small smart pointer class with automatic reference counting for IInterface.
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
boost::barrier * m_barrier
SmartIF< ISvcLocator > m_serviceLocator
ToolHandleArray< IThreadInitTool > m_tools
static std::atomic< bool > m_execFailed
void operator()() const
Execute the task.
thread_local bool ThreadInitDone
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...