GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
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 
19 #include "TGo4AnalysisClientImp.h"
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 
32 {
33 
34 }
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;
47  {
48  // no, we have to update it ourselves and fill the status buffer
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
56  } // lock guard
57  }
58  else
59  { // yes, main thread is running on that, we do nothing
60 
61  } // if(!fxAnalysisClient->TestRatemeter())
62 
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 }
TGo4AnalysisClient * fxAnalysisClient
static void Sleep(UInt_t millisecs)
Definition: TGo4Thread.cxx:295
Bool_t IsInitDone() const
TGo4Analysis * GetAnalysis() const
Bool_t MainIsRunning() const
Definition: TGo4Slave.h:95
void UpdateStatusBuffer()
Definition: TGo4Slave.cxx:152
void UpdateRate(Int_t counts=1)