GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4AnalysisWatchRunnable.cxx
Go to the documentation of this file.
1// $Id$
2//-----------------------------------------------------------------------
3// The GSI Online Offline Object Oriented (Go4) Project
4// Experiment Data Processing at EE department, GSI
5//-----------------------------------------------------------------------
6// Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7// Planckstr. 1, 64291 Darmstadt, Germany
8// Contact: http://go4.gsi.de
9//-----------------------------------------------------------------------
10// This software can be used under the license agreements as stated
11// in Go4License.txt file which is part of the distribution.
12//-----------------------------------------------------------------------
13
15
16#include "TGo4Thread.h"
17#include "TGo4Task.h"
18
20#include "TGo4AnalysisImp.h"
21
23//const UInt_t TGo4AnalysisWatchRunnable::fguWATCHINTERVAL=50;
24
26 TGo4Runnable(name,cli->GetTask()), fxAnalysisClient(cli)
27{
28 fxAnalysis = cli->GetAnalysis();
29}
30
35
37{
38 // check if ratemeter was updated
39 if (fxAnalysis)
40 {
41 static Bool_t initbefore = kFALSE; // JAM15: handle here update of status buffer after close analysis,
42 // now main thread will never SendAnalysisClientStatus at Stop() to avoid deadlocking
43 if (fxAnalysis->IsInitDone() || initbefore)
44 {
45 initbefore = kTRUE;
46 if (!fxAnalysisClient->TestRatemeter())
47 {
48 // no, we have to update it ourselves and fill the status buffer
49 if (fxAnalysisClient->MainIsRunning())
50 fxAnalysisClient->UpdateRate(0); // update with calculation of time and average rate
51 else
52 fxAnalysisClient->UpdateRate(-1); // stopped: keep latest values for time and average rate
53 {
54 //TGo4LockGuard mainguard; // in UpdateStatusBuffer now JA
55 fxAnalysisClient->UpdateStatusBuffer();
56 } // lock guard
57 }
58 else
59 { // yes, main thread is running on that, we do nothing
60
61 } // if(!fxAnalysisClient->TestRatemeter())
62
63 fxAnalysisClient->SendAnalysisClientStatus();
64 }
65
66 else
67 {
68 // analysis not yet initialized, no status to update
69 } // if (ana->fbInitIsDone)
70 } //if (fxAnalysis){
72 return 0;
73}
TGo4Analysis * GetAnalysis() const
static const UInt_t fguWATCHINTERVAL
frequency in ms for the watcher runnable to check the application
TGo4AnalysisClient * fxAnalysisClient
1
Int_t Run(void *) override
The working function which runs in the thread.
TGo4Runnable(const TGo4Runnable &right)
static void Sleep(UInt_t millisecs)
wrapper for gSystem->Sleep with consecutive TThread::CancelPoint - necessary for proper pthread termi...