![]() |
|
|
Generated: 8 Jan 2009 |
#include <GaudiKernel/ThreadGaudi.h>

Definition at line 15 of file ThreadGaudi.h.
Public Types | |
| typedef std::map < System::ThreadHandle, std::string > | ThreadMap |
Public Member Functions | |
| void | setThreadID (const std::string &threadID) |
| associate Gaudi ID to pthread | |
| ThreadMap * | getThreadMap () |
| access the whole map | |
| const std::string & | getThreadID () |
| get Gaudi ID of current pthread | |
Static Public Member Functions | |
| static ThreadGaudi * | instance () |
| singleton access | |
Protected Member Functions | |
| ThreadGaudi () | |
| virtual | ~ThreadGaudi () |
Protected Attributes | |
| ThreadMap * | m_threadMap |
| typedef std::map< System::ThreadHandle , std::string > ThreadGaudi::ThreadMap |
Definition at line 17 of file ThreadGaudi.h.
| ThreadGaudi::ThreadGaudi | ( | ) | [protected] |
Definition at line 85 of file ThreadGaudi.cpp.
00085 { 00086 m_threadMap = new ThreadMap(); 00087 (*m_threadMap)[0] = "" ; 00088 }
| ThreadGaudi::~ThreadGaudi | ( | ) | [protected, virtual] |
| ThreadGaudi * ThreadGaudi::instance | ( | ) | [static] |
singleton access
Definition at line 94 of file ThreadGaudi.cpp.
00094 { 00095 if ( 0 == ThreadGaudiInstance ) { 00096 ThreadGaudiInstance = new ThreadGaudi(); 00097 } 00098 return ThreadGaudiInstance ; 00099 }
| void ThreadGaudi::setThreadID | ( | const std::string & | threadID | ) |
associate Gaudi ID to pthread
Definition at line 101 of file ThreadGaudi.cpp.
00101 { 00102 ThreadMap* p_threadMap = getThreadMap() ; 00103 // get from name thread ID 00104 System::ThreadHandle s_pid = System::threadSelf() ; 00105 if (p_threadMap->count(s_pid) == 0 ) { 00106 (*p_threadMap)[s_pid] = threadID ; 00107 #ifdef THREAD_GAUDI__DEBUG 00108 std::cout << " *** ThreadGaudi setThreadID *** value set for *** " << threadID << " thread ID : " << s_pid << std::endl ; 00109 #endif 00110 } 00111 }
| ThreadGaudi::ThreadMap * ThreadGaudi::getThreadMap | ( | ) |
access the whole map
Definition at line 113 of file ThreadGaudi.cpp.
00113 { 00114 return ThreadGaudi::instance()->m_threadMap; 00115 }
| const std::string & ThreadGaudi::getThreadID | ( | ) |
get Gaudi ID of current pthread
Definition at line 117 of file ThreadGaudi.cpp.
00117 { 00118 ThreadMap* p_threadMap = getThreadMap() ; 00119 System::ThreadHandle s_pid = System::threadSelf() ; 00120 if ( p_threadMap->find(s_pid) != p_threadMap->end() ) { 00121 return (*p_threadMap->find(s_pid)).second ; 00122 } else { 00123 return (*p_threadMap->find(0)).second ; ; 00124 } 00125 }
ThreadMap* ThreadGaudi::m_threadMap [protected] |
Definition at line 30 of file ThreadGaudi.h.