#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
Definition at line 41 of file TGo4ThreadHandler.h.
TGo4ThreadHandler::TGo4ThreadHandler | ( | const TGo4ThreadHandler & | right | ) |
Definition at line 27 of file TGo4ThreadHandler.cxx.
TGo4ThreadHandler::TGo4ThreadHandler | ( | const char * | name, | |
TGo4ThreadManager * | parent | |||
) |
Definition at line 38 of file TGo4ThreadHandler.cxx.
TGo4ThreadHandler::~TGo4ThreadHandler | ( | ) | [virtual] |
Definition at line 50 of file TGo4ThreadHandler.cxx.
TGo4ThreadHandler::TGo4ThreadHandler | ( | ) | [private] |
Bool_t TGo4ThreadHandler::AddThread | ( | TGo4Thread * | gthr | ) |
Adds Reference to (externally created) thread to Thread List.
Definition at line 85 of file TGo4ThreadHandler.cxx.
Bool_t TGo4ThreadHandler::RemoveThread | ( | const char * | name | ) |
Bool_t TGo4ThreadHandler::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.
Definition at line 151 of file TGo4ThreadHandler.cxx.
Int_t TGo4ThreadHandler::CreateAll | ( | ) |
Bool_t TGo4ThreadHandler::Create | ( | const char * | thname | ) |
Launch the ROOT Thread specified by the Go4 Thread of name 'name'.
Name of TThread and TGo4Thread is the same.
Definition at line 201 of file TGo4ThreadHandler.cxx.
Int_t TGo4ThreadHandler::CancelAll | ( | ) |
Bool_t TGo4ThreadHandler::Cancel | ( | const char * | thname | ) |
Cancels the ROOT Thread specified by the Go4 Thread of name 'name'.
Name of TThread and TGo4Thread is the same.
Definition at line 255 of file TGo4ThreadHandler.cxx.
Int_t TGo4ThreadHandler::ReCreateAll | ( | ) |
Bool_t TGo4ThreadHandler::ReCreate | ( | const char * | thname | ) |
ReCreate (Cancel and Create) all Threads in the thread list.
Definition at line 309 of file TGo4ThreadHandler.cxx.
Int_t TGo4ThreadHandler::StartAll | ( | ) |
Start work function of all Threads in the thread list.
Definition at line 335 of file TGo4ThreadHandler.cxx.
Bool_t TGo4ThreadHandler::Start | ( | const char * | thname | ) |
Starts work function of the Go4 Thread of name 'name'.
Workfunction will run in infinite loop until Stop().
Definition at line 369 of file TGo4ThreadHandler.cxx.
Int_t TGo4ThreadHandler::StopAll | ( | ) |
Start work function of all Threads in the thread list.
Definition at line 394 of file TGo4ThreadHandler.cxx.
Bool_t TGo4ThreadHandler::Stop | ( | const char * | thname | ) |
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 422 of file TGo4ThreadHandler.cxx.
Int_t TGo4ThreadHandler::DumpThreads | ( | Int_t | mode = 0 |
) |
dumps thread process information to logging output i.e.
file or anything
Definition at line 442 of file TGo4ThreadHandler.cxx.
TGo4Thread * TGo4ThreadHandler::GetThread | ( | const char * | name | ) |
Int_t TGo4ThreadHandler::GetEntries | ( | ) |
Bool_t TGo4ThreadHandler::AllCreated | ( | ) |
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 520 of file TGo4ThreadHandler.cxx.
Bool_t TGo4ThreadHandler::AllRunning | ( | ) |
Returns true if all threads in list are running, i.e.
all workfunctions were started
Definition at line 546 of file TGo4ThreadHandler.cxx.
Bool_t TGo4ThreadHandler::AllWaiting | ( | ) |
Returns true if all threads in list are waiting, i.e.
all workfunctions are in condition wait
Definition at line 572 of file TGo4ThreadHandler.cxx.
Bool_t TGo4ThreadHandler::IsOperating | ( | ) | const [inline] |
Returns kTRUE if threadhandler performs any action that requires gSystem support.
Flag is checked by Manager before Blocking the System.
Definition at line 121 of file TGo4ThreadHandler.h.
TGo4ThreadManager* TGo4ThreadHandler::fxManager [protected] |
Backlink to threadmanager who owns this thread handler.
1 1
Definition at line 128 of file TGo4ThreadHandler.h.
Bool_t TGo4ThreadHandler::fbIsOperating [private] |
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 135 of file TGo4ThreadHandler.h.
TMutex* TGo4ThreadHandler::fxListMutex [private] |
TIterator* TGo4ThreadHandler::fxIterator [private] |
TObjArray* TGo4ThreadHandler::fxArray [private] |
TMutex* TGo4ThreadHandler::fxOperMutex [private] |
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 152 of file TGo4ThreadHandler.h.