GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
Public Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes | List of all members
TGo4AppControlTimer Class Reference

#include <TGo4AppControlTimer.h>

+ Inheritance diagram for TGo4AppControlTimer:

Public Member Functions

 TGo4AppControlTimer ()=delete
 
 TGo4AppControlTimer (TGo4ThreadManager *manager, Long_t msperiod=3000, Bool_t mode=kTRUE)
 
virtual ~TGo4AppControlTimer ()
 
void SetManager (TGo4ThreadManager *parent)
 
Bool_t Notify () override
 
const TCondition * GetCondition () const
 
void SetApplicationRun (Bool_t flag=kTRUE)
 
Bool_t GetApplicationRun () const
 

Protected Attributes

TGo4ThreadManagerfxManager {nullptr}
 

Static Protected Attributes

static UInt_t fguTERMWAIT = 3000
 
static Int_t fgiTERMWAITCYCLES = 5
 

Private Attributes

Bool_t fbApplicationRun {kFALSE}
 
TCondition * fxCondition {nullptr}
 

Detailed Description

Timer with main purpose to block the root TApplication loop during thread execution. Moreover, this timer calls Initialization() function of threadmanager, which can be overridden by user to define any actions which should not be run within a thread (critical root system calls, like opening TServerSocket, should be done within the application loop, i.e. in the timer). In threadmanager non-blocking-mode, Initialization() is called from timer regularly with the period specified in threadmanager; in blocking mode it is called once after each threadmanager UnBlockApp(). This timer is also responsible for proper termination of the threadmanager.

Author
J. Adamczewski
Go4 project-DVEE-GSI Darmstadt
Germany
Version
0.9
Since
jul 2000-oct 2001

Definition at line 39 of file TGo4AppControlTimer.h.

Constructor & Destructor Documentation

◆ TGo4AppControlTimer() [1/2]

TGo4AppControlTimer::TGo4AppControlTimer ( )
delete

◆ TGo4AppControlTimer() [2/2]

TGo4AppControlTimer::TGo4AppControlTimer ( TGo4ThreadManager manager,
Long_t  msperiod = 3000,
Bool_t  mode = kTRUE 
)

Definition at line 29 of file TGo4AppControlTimer.cxx.

References fxCondition, and GO4TRACE.

◆ ~TGo4AppControlTimer()

TGo4AppControlTimer::~TGo4AppControlTimer ( )
virtual

Definition at line 39 of file TGo4AppControlTimer.cxx.

References fxCondition, and GO4TRACE.

Member Function Documentation

◆ GetApplicationRun()

Bool_t TGo4AppControlTimer::GetApplicationRun ( ) const
inline

Status of the application run flag. If true, root application is not blocked.

Definition at line 72 of file TGo4AppControlTimer.h.

References fbApplicationRun.

Referenced by TGo4ThreadManager::UnBlockApp().

◆ GetCondition()

const TCondition* TGo4AppControlTimer::GetCondition ( ) const
inline

Returns handle for internal condition which is used to block the gSystem.

Definition at line 59 of file TGo4AppControlTimer.h.

References fxCondition.

Referenced by TGo4ThreadManager::UnBlockApp().

◆ Notify()

Bool_t TGo4AppControlTimer::Notify ( )
override

◆ SetApplicationRun()

void TGo4AppControlTimer::SetApplicationRun ( Bool_t  flag = kTRUE)
inline

Switches between blocking and non blocking mode of the timer. If set to kTRUE, timer will not block the root system. If set to kFALSE, timer will suspend in a condition wait and therefore the InnerLoop() of root is blocked.

Definition at line 67 of file TGo4AppControlTimer.h.

References fbApplicationRun.

Referenced by TGo4ThreadManager::BlockApp(), and TGo4ThreadManager::UnBlockApp().

◆ SetManager()

void TGo4AppControlTimer::SetManager ( TGo4ThreadManager parent)
inline

Sets reference to new thread manager

Definition at line 50 of file TGo4AppControlTimer.h.

References fxManager, and Notify().

Member Data Documentation

◆ fbApplicationRun

Bool_t TGo4AppControlTimer::fbApplicationRun {kFALSE}
private

Definition at line 101 of file TGo4AppControlTimer.h.

Referenced by GetApplicationRun(), Notify(), and SetApplicationRun().

◆ fgiTERMWAITCYCLES

Int_t TGo4AppControlTimer::fgiTERMWAITCYCLES = 5
staticprotected

On Termination, Notify will test fgiTERMWAITCYCLES times if Runnables are stopped, i.e. all TGo4Threads are in TCondition wait (safe cancelling point); afterwards, threads are deleted anyway

Definition at line 90 of file TGo4AppControlTimer.h.

Referenced by Notify().

◆ fguTERMWAIT

UInt_t TGo4AppControlTimer::fguTERMWAIT = 3000
staticprotected

time in ms to wait for all Runnables being stopped before Termination; after this time, the AllWaiting() of TGo4ThreadHandler is tested again, until the max number of testing cycles (fgiTERMWAITCYCLES) is reached; then Termination is done anyway

Definition at line 82 of file TGo4AppControlTimer.h.

Referenced by Notify().

◆ fxCondition

TCondition* TGo4AppControlTimer::fxCondition {nullptr}
private

◆ fxManager

TGo4ThreadManager* TGo4AppControlTimer::fxManager {nullptr}
protected

Backlink to threadmanager who owns this timer. 1 1

Definition at line 97 of file TGo4AppControlTimer.h.

Referenced by Notify(), and SetManager().


The documentation for this class was generated from the following files: