33 GO4TRACE((14,
"TGo4TestRunnable::TGo4Runnable() constructor", __LINE__, __FILE__));
38 GO4TRACE((14,
"TGo4TestRunnable::TGo4TestRunnable() copy ctor", __LINE__, __FILE__));
44 GO4TRACE((14,
"TGo4TestRunnable::TGo4TestRunnable(const char *,TGo4ThreadManager *, Int_t) constructor", __LINE__, __FILE__));
49 GO4TRACE((14,
"TGo4TestRunnable::~TGo4TestRunnable() destructor",__LINE__, __FILE__));
54 GO4TRACE((12,
"TGo4TestRunnable::Run()",__LINE__, __FILE__));
58 static Int_t loops = 0;
70 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 0",__LINE__, __FILE__));
78 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 1",__LINE__, __FILE__));
85 han->
Cancel(
"First Thread");
86 han->
Cancel(
"Second Thread");
87 han->
Cancel(
"Third Thread");
88 han->
Cancel(
"Fourth Thread");
90 TGo4Log::Debug(
"\t ''%s'' re-starting all other Threads", GetName());
91 han->
Create(
"First Thread");
92 han->
Create(
"Second Thread");
93 han->
Create(
"Third Thread");
94 han->
Create(
"Fourth Thread");
99 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 2",__LINE__, __FILE__));
100 TGo4Log::Debug(
" ControlRunnable ''%s'' running, testcase %d -- ",
103 TGo4Log::Debug(
"\t ''%s'' stopping all other Workfunctions:", GetName());
105 han->
Stop(
"First Thread");
106 han->
Stop(
"Second Thread");
107 han->
Stop(
"Third Thread");
108 han->
Stop(
"Fourth Thread");
110 TGo4Log::Debug(
"\t ''%s'' re-starting all other Workfunctions:", GetName());
111 han->
Start(
"First Thread");
112 han->
Start(
"Second Thread");
113 han->
Start(
"Third Thread");
114 han->
Start(
"Fourth Thread");
120 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 3",__LINE__, __FILE__));
121 TGo4Log::Debug(
" ControlRunnable ''%s'' running, testcase %d -- ",
132 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 4",__LINE__, __FILE__));
133 TGo4Log::Debug(
" ControlRunnable ''%s'' running, testcase %d -- ",
139 fxHisto =
new TH1D(GetName(),
"histogram",2048,0,100);
147 x=gRandom->Gaus(50,7);
151 if(strstr(GetName(),
"Maker1"))
163 TThread::CancelPoint();
167 TThread::CancelPoint();
168 if(strstr(GetName(),
"Maker1"))
199 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 5",__LINE__, __FILE__));
200 TGo4Log::Debug(
" ControlRunnable ''%s'' running, testcase %d -- ",
208 TString rname = TString::Format(
"NewHistogramMaker1:%d",loops++);
216 go4thr=
new TGo4Thread(
"First Thread",th1run,kFALSE);
244 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 6",__LINE__, __FILE__));
245 TGo4Log::Debug(
" ControlRunnable ''%s'' running, testcase %d -- ",
270 GO4TRACE((11,
"TGo4TestRunnable::Run() mode 7",__LINE__, __FILE__));
271 TGo4Log::Debug(
" ControlRunnable ''%s'' running, testcase %d -- ",
276 fxHisto =
new TH1D(GetName(),
"histogram",2048,0,100);
284 x=gRandom->Gaus(50,7);
293 TGo4Log::Debug(
"\t ''%s'' histogram %d filled, waiting", GetName(),loops);
295 TGo4Log::Debug(
"\t ''%s'' deleting histogram %d", GetName(),loops++);
302 GO4TRACE((11,
"TGo4TestRunnable::Run() mode default",__LINE__, __FILE__));
303 TGo4Log::Debug(
" TestRunnable ''%s'' mode %d -- unspecified Workfunc action! ", GetName(),
fiMode);
314 GO4TRACE((12,
"TGo4TestRunnable::ThreadCatch()",__LINE__, __FILE__));
328 GO4TRACE((12,
"TGo4TestRunnable::UnexpectedCatch()",__LINE__, __FILE__));
TGo4Thread * GetThread() const
virtual void ThreadCatch(TGo4Exception &ex)
TGo4ThreadManager * fxManager
void UnexpectedCatch() override
virtual ~TGo4TestRunnable()
Bool_t UnBlockApp(Int_t mode=0)
static void Sleep(UInt_t millisecs)
void ThreadCatch(TGo4Exception &ex) override
Int_t Run(void *ptr) override
virtual void UnexpectedCatch()
static void Debug(const char *text,...) GO4_PRINTF_ARGS
Bool_t Create(const char *thname)
Bool_t Stop(const char *thname)
Bool_t Start(const char *thname)
Bool_t Cancel(const char *thname)
TGo4ThreadHandler * GetWorkHandler() const