18 #include "TCondition.h"
22 #include "TGo4LockGuard.h"
28 GO4TRACE((14,
"TGo4Thread::TGo4Thread() copy constructor",__LINE__, __FILE__));
35 :TNamed(name,
"This is a TGo4Thread"),
43 GO4TRACE((14,
"TGo4Thread::TGo4Thread(const char*, TGo4Runnable*, Bool_t) constructor",__LINE__, __FILE__));
55 GO4TRACE((14,
"TGo4Thread::~TGo4Thread() destructor",__LINE__, __FILE__));
62 GO4TRACE((14,
"TGo4Thread::~TGo4Thread() internal mode",__LINE__, __FILE__));
69 GO4TRACE((14,
"TGo4Thread::~TGo4Thread() non internal mode",__LINE__, __FILE__));
77 GO4TRACE((2,
"TGo4Thread::Threadfunc(void*)",__LINE__, __FILE__));
87 TGo4Log::Debug(
" TThread %d (PID:%d) of Go4Thread ``%s'' started... \n",
94 GO4TRACE((1,
"TGo4Thread::Threadfunc(void*) try block",__LINE__, __FILE__));
97 TThread::CancelPoint();
100 GO4TRACE((1,
"TGo4Thread::Threadfunc(void*) waiting mode",__LINE__, __FILE__));
102 go4th->GetName(), go4th->
GetPID());
107 go4th->GetName(), go4th->
GetPID() );
117 GO4TRACE((1,
"TGo4Thread::Threadfunc(void*) entering running mode",__LINE__, __FILE__));
119 runnable->
PreRun((
void*) 0);
122 TThread::CancelPoint();
123 runnable->
Run((
void*) 0);
132 GO4TRACE((1,
"TGo4Thread::Threadfunc(void*) entering Cancel loop",__LINE__, __FILE__));
133 TGo4Log::Debug(
" Go4Thread ``%s'' entering Cancel loop\n ", go4th->GetName());
140 GO4TRACE((1,
"TGo4Thread::Threadfunc(void*) in Cancel loop",__LINE__, __FILE__));
142 TThread::CancelPoint();
150 GO4TRACE((1,
"TGo4Thread::Threadfunc(void*) Go4Exception Catch",__LINE__, __FILE__));
152 TThread::CancelPoint();
157 GO4TRACE((1,
"TGo4Thread::Threadfunc(void*) Unexpected Catch",__LINE__, __FILE__));
159 TThread::CancelPoint();
169 GO4TRACE((14,
"TGo4Thread::Create()",__LINE__, __FILE__));
189 GO4TRACE((14,
"TGo4Thread::Cancel()",__LINE__, __FILE__));
194 TGo4Log::Debug(
" Go4Thread ``%s'' -- Canceling TThread %d (PID:%d) ",
199 GO4TRACE((13,
"TGo4Thread::Cancel() -- canceling existing TThread",__LINE__, __FILE__));
208 #if ROOT_VERSION_CODE > ROOT_VERSION(6,0,0)
238 GO4TRACE((13,
"TGo4Thread::Cancel() -- Error: TThread pointer is zero!",__LINE__, __FILE__));
239 TGo4Log::Debug(
" Go4Thread ``%s'' Cancel -- Internal inconsistency error! ",GetName());
253 GO4TRACE((14,
"TGo4Thread::ReCreate()",__LINE__, __FILE__));
260 GO4TRACE((13,
"TGo4Thread::ReCreate() -- old TThread existing",__LINE__, __FILE__));
261 TGo4Log::Debug(
" Recreating Go4Thread ``%s'' -- old TThread %d (PID:%d) ",
266 GO4TRACE((13,
"TGo4Thread::ReCreate() -- recreating existing TThread",__LINE__, __FILE__));
282 TThread::Delete(oldthread);
291 GO4TRACE((13,
"TGo4Thread::ReCreate() -- Error: old TThread pointer is zero!",__LINE__, __FILE__));
292 TGo4Log::Debug(
" Go4Thread ``%s'' ReCreate -- Internal inconsistency error! ",GetName());
301 GO4TRACE((13,
"TGo4Thread::ReCreate() -- old TThread existing",__LINE__, __FILE__));
309 GO4TRACE((12,
"TGo4Thread::Start()",__LINE__, __FILE__));
314 GO4TRACE((11,
"TGo4Thread::Start() -- creating new TThread",__LINE__, __FILE__));
320 GO4TRACE((11,
"TGo4Thread::Start() -- TThread already existing",__LINE__, __FILE__));
330 GO4TRACE((12,
"TGo4Thread::Stop()",__LINE__, __FILE__));
338 GO4TRACE((12,
"TGo4Thread::Sleep()",__LINE__, __FILE__));
339 gSystem->Sleep(millisecs);
340 TThread::CancelPoint();
virtual void ThreadCatch(TGo4Exception &ex)
void SetWaiting(Bool_t mode=kTRUE)
static void Sleep(UInt_t millisecs)
static void Threadfunc(void *arg)
virtual Int_t PreRun(void *ptr)
void SetThread(TGo4Thread *gthread)
virtual Int_t Run(void *ptr)=0
TGo4Runnable * GetRunnable() const
virtual Int_t PostRun(void *ptr)
TGo4Runnable * fxRunnable
TCondition * GetCondition() const
static void Debug(const char *text,...)