#include <TGo4ThreadHandler.h>
Public Member Functions | |
TGo4ThreadHandler (const TGo4ThreadHandler &right) | |
TGo4ThreadHandler (const char *name, TGo4ThreadManager *parent) | |
virtual | ~TGo4ThreadHandler () |
Bool_t | AddThread (TGo4Thread *gthr) |
Adds Reference to (externally created) thread to Thread List. | |
Bool_t | RemoveThread (const char *name) |
Remove thread by name from Thread List. | |
Bool_t | NewThread (const char *name, TGo4Runnable *runnable) |
Creates new internal Go4 Thread with name and adds it to the List External runnable is passed to specify the threaded actions. | |
Int_t | CreateAll () |
Launch all Threads in the thread list. | |
Bool_t | Create (const char *thname) |
Launch the ROOT Thread specified by the Go4 Thread of name 'name'. | |
Int_t | CancelAll () |
Cancel all Threads in the thread list. | |
Bool_t | Cancel (const char *thname) |
Cancels the ROOT Thread specified by the Go4 Thread of name 'name'. | |
Int_t | ReCreateAll () |
Recreate all Threads in the thread list. | |
Bool_t | ReCreate (const char *thname) |
ReCreate (Cancel and Create) all Threads in the thread list. | |
Int_t | StartAll () |
Start work function of all Threads in the thread list. | |
Bool_t | Start (const char *thname) |
Starts work function of the Go4 Thread of name 'name'. | |
Int_t | StopAll () |
Start work function of all Threads in the thread list. | |
Bool_t | Stop (const char *thname) |
Stops work function of the Go4 Thread of name 'name'. | |
Int_t | DumpThreads (Int_t mode=0) |
dumps thread process information to logging output i.e. | |
TGo4Thread * | GetThread (const char *name) |
Access to Go4Thread by name. | |
Int_t | GetEntries () |
Number of threads in list. | |
Bool_t | AllCreated () |
Returns true if all root threads in list are existing, i.e. | |
Bool_t | AllRunning () |
Returns true if all threads in list are running, i.e. | |
Bool_t | AllWaiting () |
Returns true if all threads in list are waiting, i.e. | |
Bool_t | IsOperating () const |
Returns kTRUE if threadhandler performs any action that requires gSystem support. | |
Protected Attributes | |
TGo4ThreadManager * | fxManager |
Backlink to threadmanager who owns this thread handler. | |
Private Member Functions | |
TGo4ThreadHandler () | |
Private Attributes | |
Bool_t | fbIsOperating |
kTRUE, if threadhandler performs any action that requires gSystem support. | |
TMutex * | fxListMutex |
Mutex protecting thread array. | |
TIterator * | fxIterator |
Iterator for Thread Array. | |
TObjArray * | fxArray |
Array of Go4Threads. | |
TMutex * | fxOperMutex |
Mutex to protect IsOperating flag, flag is set kTRUE to indicate that AppControl timer must not block, since thread launching or canceling operation is performed by thread handler. |
.. knows threadmanager instance that owns the handler (that owns the task connector which owns the thread handler, respectively) this threadmanager instance pointer is given to each thread and runnable on creation, thus each thread can acces its manager methods by threadmanager pointer
Go4 project-DVEE-GSI Darmstadt
Germany
Definition at line 43 of file TGo4ThreadHandler.h.
|
Definition at line 29 of file TGo4ThreadHandler.cxx. References fxArray, fxIterator, fxListMutex, fxManager, fxOperMutex, and TRACE. |
|
Definition at line 40 of file TGo4ThreadHandler.cxx. References fxArray, fxIterator, fxListMutex, fxManager, fxOperMutex, and TRACE. |
|
Definition at line 52 of file TGo4ThreadHandler.cxx. References CancelAll(), fxArray, fxIterator, fxListMutex, fxOperMutex, TGo4Thread::IsInternal(), StopAll(), and TRACE. |
|
|
|
Adds Reference to (externally created) thread to Thread List.
Definition at line 87 of file TGo4ThreadHandler.cxx. References fxArray, fxListMutex, and TRACE. Referenced by NewThread(). |
|
Remove thread by name from Thread List.
Definition at line 111 of file TGo4ThreadHandler.cxx. References TGo4ThreadManager::BlockApp(), fbIsOperating, fxArray, fxListMutex, fxManager, fxOperMutex, TGo4Thread::IsInternal(), TRACE, and TGo4ThreadManager::UnBlockApp(). Referenced by TGo4ReplaceException::Handle(), TGo4RemoveException::Handle(), TGo4HistogramServer::~TGo4HistogramServer(), and TGo4TaskHandler::~TGo4TaskHandler(). |
|
Creates new internal Go4 Thread with name and adds it to the List External runnable is passed to specify the threaded actions.
Definition at line 153 of file TGo4ThreadHandler.cxx. References AddThread(), and TRACE. Referenced by TGo4AnalysisClient::Constructor(), TGo4ReplaceException::Handle(), TGo4ExampleClient::TGo4ExampleClient(), TGo4ExampleServer::TGo4ExampleServer(), TGo4HistogramServer::TGo4HistogramServer(), TGo4ServerTask::TGo4ServerTask(), TGo4TaskHandler::TGo4TaskHandler(), and TGo4TestThreadManager::TGo4TestThreadManager(). |
|
Launch all Threads in the thread list.
Definition at line 173 of file TGo4ThreadHandler.cxx. References TGo4ThreadManager::BlockApp(), TGo4Thread::Create(), fbIsOperating, fxIterator, fxListMutex, fxManager, fxOperMutex, TRACE, and TGo4ThreadManager::UnBlockApp(). Referenced by TGo4ThreadManager::Launch(). |
|
Launch the ROOT Thread specified by the Go4 Thread of name 'name'. Name of TThread and TGo4Thread is the same. Definition at line 203 of file TGo4ThreadHandler.cxx. References TGo4ThreadManager::BlockApp(), TGo4Thread::Create(), fbIsOperating, fxManager, fxOperMutex, GetThread(), TRACE, and TGo4ThreadManager::UnBlockApp(). Referenced by TGo4CreateException::Handle(), and TGo4TestRunnable::Run(). |
|
Cancel all Threads in the thread list.
Definition at line 228 of file TGo4ThreadHandler.cxx. References TGo4Thread::Cancel(), fbIsOperating, fxIterator, fxListMutex, fxOperMutex, and TRACE. Referenced by TGo4ExampleClient::~TGo4ExampleClient(), TGo4ExampleServer::~TGo4ExampleServer(), and ~TGo4ThreadHandler(). |
|
Cancels the ROOT Thread specified by the Go4 Thread of name 'name'. Name of TThread and TGo4Thread is the same. Definition at line 257 of file TGo4ThreadHandler.cxx. References TGo4ThreadManager::BlockApp(), TGo4Thread::Cancel(), fbIsOperating, fxManager, fxOperMutex, GetThread(), TRACE, and TGo4ThreadManager::UnBlockApp(). Referenced by TGo4CancelException::Handle(), and TGo4TestRunnable::Run(). |
|
Recreate all Threads in the thread list.
Definition at line 282 of file TGo4ThreadHandler.cxx. References fbIsOperating, fxIterator, fxListMutex, fxOperMutex, TGo4Thread::ReCreate(), and TRACE. |
|
ReCreate (Cancel and Create) all Threads in the thread list.
Definition at line 311 of file TGo4ThreadHandler.cxx. References TGo4ThreadManager::BlockApp(), fbIsOperating, fxManager, fxOperMutex, GetThread(), TGo4Thread::ReCreate(), TRACE, and TGo4ThreadManager::UnBlockApp(). Referenced by TGo4RestartException::Handle(). |
|
Start work function of all Threads in the thread list.
Definition at line 337 of file TGo4ThreadHandler.cxx. References TGo4ThreadManager::BlockApp(), fbIsOperating, fxIterator, fxListMutex, fxManager, fxOperMutex, TGo4Thread::Start(), TRACE, and TGo4ThreadManager::UnBlockApp(). Referenced by TGo4ClientTask::ConnectServer(), and TGo4ThreadManager::Initialization(). |
|
Starts work function of the Go4 Thread of name 'name'. Workfunction will run in infinite loop until Stop(). Definition at line 371 of file TGo4ThreadHandler.cxx. References TGo4ThreadManager::BlockApp(), fbIsOperating, fxManager, fxOperMutex, GetThread(), TGo4Thread::Start(), TRACE, and TGo4ThreadManager::UnBlockApp(). Referenced by TGo4StartException::Handle(), TGo4ReplaceException::Handle(), TGo4Task::Initialization(), TGo4TestRunnable::Run(), TGo4ExampleClient::Start(), TGo4TaskHandler::StartTransportThreads(), TGo4ExampleServer::StartWorkThreads(), TGo4Task::SubmitLocalCommand(), and TGo4HistogramServer::TGo4HistogramServer(). |
|
Start work function of all Threads in the thread list.
Definition at line 396 of file TGo4ThreadHandler.cxx. References fxIterator, fxListMutex, TGo4Thread::Stop(), and TRACE. Referenced by TGo4ThreadManager::Terminate(), and ~TGo4ThreadHandler(). |
|
Stops work function of the Go4 Thread of name 'name'. Thread will suspend to condition wait without being killed. Workfunction will continue loop on next Sart(). Definition at line 424 of file TGo4ThreadHandler.cxx. References GetThread(), TGo4Thread::Stop(), and TRACE. Referenced by TGo4TestRunnable::Run(), TGo4ExampleClient::Stop(), TGo4TaskHandler::StopTransportThreads(), TGo4ExampleServer::StopWorkThreads(), and TGo4HistogramServer::~TGo4HistogramServer(). |
|
dumps thread process information to logging output i.e. file or anything Definition at line 444 of file TGo4ThreadHandler.cxx. References TGo4Log::Debug(), fxIterator, fxListMutex, TGo4Log::GetIgnoreLevel(), TGo4Thread::GetPID(), TGo4Thread::GetSelfID(), and TRACE. Referenced by TGo4ThreadManager::Initialization(). |
|
Access to Go4Thread by name.
Definition at line 500 of file TGo4ThreadHandler.cxx. References fxArray, fxListMutex, and TRACE. Referenced by Cancel(), Create(), ReCreate(), Start(), Stop(), and TGo4TaskHandler::WaitThreadStop(). |
|
Number of threads in list.
Definition at line 511 of file TGo4ThreadHandler.cxx. References fxArray, fxListMutex, and TRACE. |
|
Returns true if all root threads in list are existing, i.e. there is a pid and a valid thread pointer for them in go4 thread Definition at line 522 of file TGo4ThreadHandler.cxx. References fxIterator, fxListMutex, TGo4Thread::GetPID(), and TRACE. Referenced by TGo4ThreadManager::Initialization(). |
|
Returns true if all threads in list are running, i.e. all workfunctions were started Definition at line 548 of file TGo4ThreadHandler.cxx. References fxIterator, fxListMutex, TGo4Thread::IsRunning(), and TRACE. |
|
Returns true if all threads in list are waiting, i.e. all workfunctions are in condition wait Definition at line 574 of file TGo4ThreadHandler.cxx. References fxIterator, fxListMutex, TGo4Thread::IsWaiting(), and TRACE. |
|
Returns kTRUE if threadhandler performs any action that requires gSystem support. Flag is checked by Manager before Blocking the System. Definition at line 123 of file TGo4ThreadHandler.h. References fbIsOperating. Referenced by TGo4ThreadManager::BlockApp(). |
|
Backlink to threadmanager who owns this thread handler. 1 1 Definition at line 130 of file TGo4ThreadHandler.h. Referenced by Cancel(), Create(), CreateAll(), ReCreate(), RemoveThread(), Start(), StartAll(), and TGo4ThreadHandler(). |
|
kTRUE, if threadhandler performs any action that requires gSystem support. Flag is checked by Manager before Blocking the System using IsOperating() method Definition at line 137 of file TGo4ThreadHandler.h. Referenced by Cancel(), CancelAll(), Create(), CreateAll(), IsOperating(), ReCreate(), ReCreateAll(), RemoveThread(), Start(), and StartAll(). |
|
Mutex protecting thread array.
Definition at line 140 of file TGo4ThreadHandler.h. Referenced by AddThread(), AllCreated(), AllRunning(), AllWaiting(), CancelAll(), CreateAll(), DumpThreads(), GetEntries(), GetThread(), ReCreateAll(), RemoveThread(), StartAll(), StopAll(), TGo4ThreadHandler(), and ~TGo4ThreadHandler(). |
|
Iterator for Thread Array.
Definition at line 143 of file TGo4ThreadHandler.h. Referenced by AllCreated(), AllRunning(), AllWaiting(), CancelAll(), CreateAll(), DumpThreads(), ReCreateAll(), StartAll(), StopAll(), TGo4ThreadHandler(), and ~TGo4ThreadHandler(). |
|
Array of Go4Threads.
Definition at line 146 of file TGo4ThreadHandler.h. Referenced by AddThread(), GetEntries(), GetThread(), RemoveThread(), TGo4ThreadHandler(), and ~TGo4ThreadHandler(). |
|
Mutex to protect IsOperating flag, flag is set kTRUE to indicate that AppControl timer must not block, since thread launching or canceling operation is performed by thread handler. This state is checked by threadmanager in BlockApp() method before enabling timer wait. Mechanism should prevent timer deadlocks. Definition at line 154 of file TGo4ThreadHandler.h. Referenced by Cancel(), CancelAll(), Create(), CreateAll(), ReCreate(), ReCreateAll(), RemoveThread(), Start(), StartAll(), TGo4ThreadHandler(), and ~TGo4ThreadHandler(). |