17#include "TCondition.h"
31 GO4TRACE((15,
"TGo4ThreadManager::TGo4ThreadManager(const TGo4ThreadManager &)",__LINE__, __FILE__));
37 :TNamed(name,
"This is a TGo4ThreadManager"),
43 GO4TRACE((15,
"TGo4ThreadManager::TGo4ThreadManager(const char *, Bool_t, Bool_t, Bool_t)",__LINE__, __FILE__));
45 TString myname=GetName();
47 myname+=gSystem->HostName();
49 myname+=gSystem->GetPid();
50 SetName(myname.Data());
51 TString nomen(
"ThreadHandler of "); nomen+=GetName();
60 TGo4Log::Debug(
" ThreadManager -- Starting in application blocking mode ");
66 TGo4Log::Debug(
" ThreadManager -- Starting in application non-blocking mode ");
74 GO4TRACE((15,
"TGo4ThreadManager::~TGo4ThreadManager()",__LINE__, __FILE__));
82 GO4TRACE((12,
"TGo4ThreadManager::BlockApp()",__LINE__, __FILE__));
88 GO4TRACE((11,
"TGo4ThreadManager::BlockApp() blocking mode",__LINE__, __FILE__));
96 GO4TRACE((11,
"TGo4ThreadManager::BlockApp() unblocking mode",__LINE__, __FILE__));
110 GO4TRACE((12,
"TGo4ThreadManager::UnBlockApp()",__LINE__, __FILE__));
116 GO4TRACE((11,
"TGo4ThreadManager::UnBlockApp() mode 0",__LINE__, __FILE__));
122 ((TCondition*)
fxBlocker->GetCondition() )->Signal();
129 GO4TRACE((11,
"TGo4ThreadManager::UnBlockApp() mode 1",__LINE__, __FILE__));
136 GO4TRACE((11,
"TGo4ThreadManager::UnBlockApp() mode 2",__LINE__, __FILE__));
140 ((TCondition*)
fxBlocker->GetCondition() )->Signal();
147 GO4TRACE((16,
"++TGo4ThreadManager::UnBlockApp() unknown mode"));
158 GO4TRACE((12,
"TGo4ThreadManager::Initialization()",__LINE__, __FILE__));
162 GO4TRACE((11,
"TGo4ThreadManager::Initialization()--already init done, returning",__LINE__, __FILE__));
171 GO4TRACE((11,
"TGo4ThreadManager::Initialization()--in AutoCreate mode",__LINE__, __FILE__));
175 TGo4Log::Debug(
" ThreadManager -- All threads are up, writing dump file ");
181 GO4TRACE((11,
"TGo4ThreadManager::Initialization()--in AutoStart mode",__LINE__, __FILE__));
186 GO4TRACE((11,
"TGo4ThreadManager::Initialization()--in non-AutoStart mode",__LINE__, __FILE__));
197 TGo4Log::Debug(
" ThreadManager -- some threads are missing, re-doing Init ");
204 GO4TRACE((11,
"TGo4ThreadManager::Initialization()--not in AutoCreate mode",__LINE__, __FILE__));
213 GO4TRACE((15,
"TGo4ThreadManager::Launch()",__LINE__, __FILE__));
217 GO4TRACE((13,
"TGo4ThreadManager::Launch()-- executing AutoCreate mode",__LINE__, __FILE__));
223 GO4TRACE((13,
"TGo4ThreadManager::Launch()-- no AutoCreate mode",__LINE__, __FILE__));
230 GO4TRACE((15,
"TGo4ThreadManager::Terminate()",__LINE__, __FILE__));
237 GO4TRACE((13,
"TGo4ThreadManager::Terminate()--waking up timer:",__LINE__, __FILE__));
Timer with main purpose to block the root TApplication loop during thread execution.
static void Debug(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 0.
TGo4ThreadHandler * fxWorkHandler
Thread handler aggregate (threadsafe list of go4 threads) aggregationByValue 1 1.
Bool_t UnBlockApp(Int_t mode=0)
Wakes up the control timer waiting for his condition; parameter mode specifies whether timer will blo...
Bool_t fbAutoStart
If true, workfunctions (runnable Run()) of all go4threads in list shall be started automatically on I...
virtual void TerminateFast()
Alternative termination in case of error.
Bool_t fbTerminating
flag showing termination status
Bool_t fbInitDone
is set kTRUE after first Initialize is done
TGo4AppControlTimer * fxBlocker
Composition of Application control timer.
virtual Int_t Initialization()
virtual ~TGo4ThreadManager()
static const Long_t fglTIMERPERIOD
Period in ms for the application control timer.
Bool_t fbAutoCreate
If true, TThreads of all go4threads in list shall be created automatically on calling Launch().
Bool_t BlockApp()
Blocks gSystem by means of the blocking timer.
Bool_t fbAppBlocking
true if threadmanager shall block root gSystem using the AppControlTimer; false if gSystem shall neve...
TGo4ThreadManager(const TGo4ThreadManager &right)
Bool_t fbTerminateApplication
If true, terminate complete application.
virtual void Terminate(Bool_t termap=kTRUE)
deletes the Manager instance via Control timer.
void Launch()
This Method has to be called to create the startup threads and to turn on the application control tim...