#include <TGo4ThreadManager.h>
Public Types | |
enum | { fguTEXTLENGTH = 256 } |
Default textlength for char arrays. More... | |
Public Member Functions | |
TGo4ThreadManager (const TGo4ThreadManager &right) | |
TGo4ThreadManager (const char *name, Bool_t blockingmode=kTRUE, Bool_t autostart=kTRUE, Bool_t autocreate=kTRUE) | |
ctor parameters: blockingmode=true: gApplication is blocked by timer autostart=true: all thread runnables start their work on Initialization() autocreate=true: all threads added to handler in threadmanager ctor are created on Launch() | |
virtual | ~TGo4ThreadManager () |
void | SetTimer (TGo4AppControlTimer *ctrltimer) |
user can exchange the standard control timer by an own derived one by this method | |
TGo4ThreadHandler * | GetWorkHandler () const |
Access to ThreadHandler for working threads. | |
Bool_t | BlockApp () |
Blocks gSystem by means of the blocking timer. | |
Bool_t | UnBlockApp (Int_t mode=0) |
Wakes up the control timer waiting for his condition; parameter mode specifies whether timer will block again at next turn (mode=0), timer will block when all threads are up (mode=1), or timer will not block again unless the next Block call, i.e. | |
virtual Int_t | Initialization () |
Bool_t | IsInitDone () const |
Bool_t | IsTerminating () const |
returns termination status of Threadmanager | |
Bool_t | IsTerminateApp () const |
Bool_t | IsAppBlocking () const |
Returns true if threadmanager works in root system blocking mode. | |
Bool_t | IsBeingQuit () const |
Returns true if threadmanager works in root system blocking mode. | |
void | SetBeingQuit (Bool_t on) |
void | Launch () |
This Method has to be called to create the startup threads and to turn on the application control timer. | |
virtual void | Terminate (Bool_t termapp=kTRUE) |
deletes the Manager instance via Control timer. | |
virtual void | TerminateFast () |
Alternative termination in case of error. | |
Static Public Attributes | |
static const Long_t | fglTIMERPERIOD = 200 |
Period in ms for the application control timer. | |
Protected Attributes | |
Bool_t | fbInitDone |
is set kTRUE after first Initialize is done | |
Bool_t | fbTerminating |
flag showing termination status | |
Bool_t | fbTerminateApplication |
If true, terminate complete application. | |
Bool_t | fbAppBlocking |
true if threadmanager shall block root gSystem using the AppControlTimer; false if gSystem shall never be blocked (necessary for gui) | |
Bool_t | fbAutoCreate |
If true, TThreads of all go4threads in list shall be created automatically on calling Launch(). | |
Bool_t | fbAutoStart |
If true, workfunctions (runnable Run()) of all go4threads in list shall be started automatically on Initialization. | |
Int_t | fbBeingQuit |
TGo4AppControlTimer * | fxBlocker |
Composition of Application control timer. | |
TGo4ThreadHandler * | fxWorkHandler |
Thread handler aggregate (threadsafe list of go4 threads) 1 1. | |
Private Member Functions | |
TGo4ThreadManager () |
Definition at line 31 of file TGo4ThreadManager.h.
anonymous enum |
TGo4ThreadManager::TGo4ThreadManager | ( | const TGo4ThreadManager & | right | ) |
Definition at line 28 of file TGo4ThreadManager.cxx.
TGo4ThreadManager::TGo4ThreadManager | ( | const char * | name, | |
Bool_t | blockingmode = kTRUE , |
|||
Bool_t | autostart = kTRUE , |
|||
Bool_t | autocreate = kTRUE | |||
) |
ctor parameters: blockingmode=true: gApplication is blocked by timer autostart=true: all thread runnables start their work on Initialization() autocreate=true: all threads added to handler in threadmanager ctor are created on Launch()
Definition at line 39 of file TGo4ThreadManager.cxx.
TGo4ThreadManager::~TGo4ThreadManager | ( | ) | [virtual] |
Definition at line 75 of file TGo4ThreadManager.cxx.
TGo4ThreadManager::TGo4ThreadManager | ( | ) | [private] |
void TGo4ThreadManager::SetTimer | ( | TGo4AppControlTimer * | ctrltimer | ) | [inline] |
user can exchange the standard control timer by an own derived one by this method
Definition at line 46 of file TGo4ThreadManager.h.
TGo4ThreadHandler* TGo4ThreadManager::GetWorkHandler | ( | ) | const [inline] |
Bool_t TGo4ThreadManager::BlockApp | ( | ) |
Bool_t TGo4ThreadManager::UnBlockApp | ( | Int_t | mode = 0 |
) |
Wakes up the control timer waiting for his condition; parameter mode specifies whether timer will block again at next turn (mode=0), timer will block when all threads are up (mode=1), or timer will not block again unless the next Block call, i.e.
applicationrun flag is reset (mode=2)
Definition at line 111 of file TGo4ThreadManager.cxx.
Int_t TGo4ThreadManager::Initialization | ( | ) | [virtual] |
Reimplemented in TGo4ClientTask, and TGo4Task.
Definition at line 159 of file TGo4ThreadManager.cxx.
Bool_t TGo4ThreadManager::IsInitDone | ( | ) | const [inline] |
Definition at line 64 of file TGo4ThreadManager.h.
Bool_t TGo4ThreadManager::IsTerminating | ( | ) | const [inline] |
Bool_t TGo4ThreadManager::IsTerminateApp | ( | ) | const [inline] |
Definition at line 69 of file TGo4ThreadManager.h.
Bool_t TGo4ThreadManager::IsAppBlocking | ( | ) | const [inline] |
Returns true if threadmanager works in root system blocking mode.
Definition at line 72 of file TGo4ThreadManager.h.
Bool_t TGo4ThreadManager::IsBeingQuit | ( | ) | const [inline] |
Returns true if threadmanager works in root system blocking mode.
Definition at line 76 of file TGo4ThreadManager.h.
void TGo4ThreadManager::SetBeingQuit | ( | Bool_t | on | ) | [inline] |
Definition at line 78 of file TGo4ThreadManager.h.
void TGo4ThreadManager::Launch | ( | ) |
This Method has to be called to create the startup threads and to turn on the application control timer.
Usually this is done at the end of the user's threadmanager constructor. The idea is that no thread should be started unless the user initializations are done; therefore, its up to the user to define when to Launch.
Definition at line 217 of file TGo4ThreadManager.cxx.
void TGo4ThreadManager::Terminate | ( | Bool_t | termapp = kTRUE |
) | [virtual] |
deletes the Manager instance via Control timer.
If termap is true, also terminates the root Application
Reimplemented in TGo4Task.
Definition at line 234 of file TGo4ThreadManager.cxx.
void TGo4ThreadManager::TerminateFast | ( | ) | [virtual] |
Alternative termination in case of error.
Reimplemented in TGo4Task.
Definition at line 248 of file TGo4ThreadManager.cxx.
const Long_t TGo4ThreadManager::fglTIMERPERIOD = 200 [static] |
Bool_t TGo4ThreadManager::fbInitDone [protected] |
Bool_t TGo4ThreadManager::fbTerminating [protected] |
Bool_t TGo4ThreadManager::fbTerminateApplication [protected] |
If true, terminate complete application.
If false, only terminate threadmanager instance.
Definition at line 112 of file TGo4ThreadManager.h.
Bool_t TGo4ThreadManager::fbAppBlocking [protected] |
true if threadmanager shall block root gSystem using the AppControlTimer; false if gSystem shall never be blocked (necessary for gui)
Definition at line 117 of file TGo4ThreadManager.h.
Bool_t TGo4ThreadManager::fbAutoCreate [protected] |
If true, TThreads of all go4threads in list shall be created automatically on calling Launch().
Definition at line 121 of file TGo4ThreadManager.h.
Bool_t TGo4ThreadManager::fbAutoStart [protected] |
If true, workfunctions (runnable Run()) of all go4threads in list shall be started automatically on Initialization.
If false, TThreads may be running, but workfunctions suspend in condition wait.
Definition at line 126 of file TGo4ThreadManager.h.
Int_t TGo4ThreadManager::fbBeingQuit [protected] |
Definition at line 131 of file TGo4ThreadManager.h.
TGo4AppControlTimer* TGo4ThreadManager::fxBlocker [protected] |
TGo4ThreadHandler* TGo4ThreadManager::fxWorkHandler [protected] |
Thread handler aggregate (threadsafe list of go4 threads) 1 1.
Definition at line 143 of file TGo4ThreadManager.h.