16 #include "TApplication.h"
35 GO4TRACE((14,
"TGo4TestRunnable::TGo4Runnable() constructor",__LINE__, __FILE__));
41 GO4TRACE((14,
"TGo4TestRunnable::TGo4TestRunnable() copy ctor",__LINE__, __FILE__));
48 GO4TRACE((14,
"TGo4TestRunnable::TGo4TestRunnable(const char*,TGo4ThreadManager*,Int_t) constructor",__LINE__, __FILE__));
55 GO4TRACE((14,
"TGo4TestRunnable::~TGo4TestRunnable() destructor",__LINE__, __FILE__));
60 GO4TRACE((12,
"TGo4TestRunnable::Run()",__LINE__, __FILE__));
77 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 0",__LINE__, __FILE__));
85 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 1",__LINE__, __FILE__));
92 han->
Cancel(
"First Thread");
93 han->
Cancel(
"Second Thread");
94 han->
Cancel(
"Third Thread");
95 han->
Cancel(
"Fourth Thread");
97 TGo4Log::Debug(
"\t ''%s'' re-starting all other Threads", GetName());
98 han->
Create(
"First Thread");
99 han->
Create(
"Second Thread");
100 han->
Create(
"Third Thread");
101 han->
Create(
"Fourth Thread");
106 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 2",__LINE__, __FILE__));
107 TGo4Log::Debug(
" ControlRunnable ''%s'' running, testcase %d -- ",
110 TGo4Log::Debug(
"\t ''%s'' stopping all other Workfunctions:", GetName());
112 han->
Stop(
"First Thread");
113 han->
Stop(
"Second Thread");
114 han->
Stop(
"Third Thread");
115 han->
Stop(
"Fourth Thread");
117 TGo4Log::Debug(
"\t ''%s'' re-starting all other Workfunctions:", GetName());
118 han->
Start(
"First Thread");
119 han->
Start(
"Second Thread");
120 han->
Start(
"Third Thread");
121 han->
Start(
"Fourth Thread");
127 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 3",__LINE__, __FILE__));
128 TGo4Log::Debug(
" ControlRunnable ''%s'' running, testcase %d -- ",
139 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 4",__LINE__, __FILE__));
140 TGo4Log::Debug(
" ControlRunnable ''%s'' running, testcase %d -- ",
146 fxHisto =
new TH1D(GetName(),
"histogram",2048,0,100);
154 x=gRandom->Gaus(50,7);
158 if(strstr(GetName(),
"Maker1"))
170 TThread::CancelPoint();
174 TThread::CancelPoint();
175 if(strstr(GetName(),
"Maker1"))
206 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 5",__LINE__, __FILE__));
207 TGo4Log::Debug(
" ControlRunnable ''%s'' running, testcase %d -- ",
215 TString rname = TString::Format(
"NewHistogramMaker1:%d",loops++);
223 go4thr=
new TGo4Thread(
"First Thread",th1run,kFALSE);
251 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 6",__LINE__, __FILE__));
252 TGo4Log::Debug(
" ControlRunnable ''%s'' running, testcase %d -- ",
277 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 7",__LINE__, __FILE__));
278 TGo4Log::Debug(
" ControlRunnable ''%s'' running, testcase %d -- ",
283 fxHisto =
new TH1D(GetName(),
"histogram",2048,0,100);
291 x=gRandom->Gaus(50,7);
300 TGo4Log::Debug(
"\t ''%s'' histogram %d filled, waiting", GetName(),loops);
302 TGo4Log::Debug(
"\t ''%s'' deleting histogram %d", GetName(),loops++);
309 GO4TRACE((11,
"TGo4TestRunnable::Run() mode default",__LINE__, __FILE__));
310 TGo4Log::Debug(
" TestRunnable ''%s'' -- unspecified Workfunc action! ",
322 GO4TRACE((12,
"TGo4TestRunnable::ThreadCatch()",__LINE__, __FILE__));
336 GO4TRACE((12,
"TGo4TestRunnable::UnexpectedCatch()",__LINE__, __FILE__));
virtual void ThreadCatch(TGo4Exception &ex)
TGo4ThreadManager * fxManager
virtual ~TGo4TestRunnable()
TGo4Thread * GetThread() const
Bool_t UnBlockApp(Int_t mode=0)
static void Sleep(UInt_t millisecs)
virtual void UnexpectedCatch()
virtual Int_t Run(void *ptr)
virtual void UnexpectedCatch()
TGo4ThreadHandler * GetWorkHandler() const
Bool_t Create(const char *thname)
Bool_t Stop(const char *thname)
Bool_t Start(const char *thname)
Bool_t Cancel(const char *thname)
virtual void ThreadCatch(TGo4Exception &ex)
static void Debug(const char *text,...)